output.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. TiMidity -- Experimental MIDI to WAVE converter
  3. Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. output.h
  16. */
  17. #include <stdio.h>
  18. #include "timidity.h"
  19. /* Data format encoding bits */
  20. #define PE_MONO 0x01 /* versus stereo */
  21. #define PE_SIGNED 0x02 /* versus unsigned */
  22. #define PE_16BIT 0x04 /* versus 8-bit */
  23. #define PE_ULAW 0x08 /* versus linear */
  24. #define PE_BYTESWAP 0x10 /* versus the other way */
  25. extern int init_buffers(int kbytes);
  26. /* Conversion functions -- These overwrite the int32_t data in *lp with
  27. data in another format */
  28. /* The size of the output buffers */
  29. extern int AUDIO_BUFFER_SIZE;
  30. /* Actual copy function */
  31. extern void (*s32tobuf)(void *dp, int32_t *lp, int32_t c);
  32. /* 8-bit signed and unsigned*/
  33. extern void s32tos8(void *dp, int32_t *lp, int32_t c);
  34. extern void s32tou8(void *dp, int32_t *lp, int32_t c);
  35. /* 16-bit */
  36. extern void s32tos16(void *dp, int32_t *lp, int32_t c);
  37. extern void s32tou16(void *dp, int32_t *lp, int32_t c);
  38. /* byte-exchanged 16-bit */
  39. extern void s32tos16x(void *dp, int32_t *lp, int32_t c);
  40. extern void s32tou16x(void *dp, int32_t *lp, int32_t c);
  41. /* uLaw (8 bits) */
  42. extern void s32toulaw(void *dp, int32_t *lp, int32_t c);
  43. /* little-endian and big-endian specific */
  44. #ifdef LITTLE_ENDIAN
  45. #define s32tou16l s32tou16
  46. #define s32tou16b s32tou16x
  47. #define s32tos16l s32tos16
  48. #define s32tos16b s32tos16x
  49. #else
  50. #define s32tou16l s32tou16x
  51. #define s32tou16b s32tou16
  52. #define s32tos16l s32tos16x
  53. #define s32tos16b s32tos16
  54. #endif