SDL_audio_c.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2022 Sam Lantinga <[email protected]>
  4. This software is provided 'as-is', without any express or implied
  5. warranty. In no event will the authors be held liable for any damages
  6. arising from the use of this software.
  7. Permission is granted to anyone to use this software for any purpose,
  8. including commercial applications, and to alter it and redistribute it
  9. freely, subject to the following restrictions:
  10. 1. The origin of this software must not be misrepresented; you must not
  11. claim that you wrote the original software. If you use this software
  12. in a product, an acknowledgment in the product documentation would be
  13. appreciated but is not required.
  14. 2. Altered source versions must be plainly marked as such, and must not be
  15. misrepresented as being the original software.
  16. 3. This notice may not be removed or altered from any source distribution.
  17. */
  18. #ifndef SDL_audio_c_h_
  19. #define SDL_audio_c_h_
  20. #include "../SDL_internal.h"
  21. #ifndef DEBUG_CONVERT
  22. #define DEBUG_CONVERT 0
  23. #endif
  24. #if DEBUG_CONVERT
  25. #define LOG_DEBUG_CONVERT(from, to) fprintf(stderr, "Converting %s to %s.\n", from, to);
  26. #else
  27. #define LOG_DEBUG_CONVERT(from, to)
  28. #endif
  29. /* Functions and variables exported from SDL_audio.c for SDL_sysaudio.c */
  30. #ifdef HAVE_LIBSAMPLERATE_H
  31. #include "samplerate.h"
  32. extern SDL_bool SRC_available;
  33. extern int SRC_converter;
  34. extern SRC_STATE* (*SRC_src_new)(int converter_type, int channels, int *error);
  35. extern int (*SRC_src_process)(SRC_STATE *state, SRC_DATA *data);
  36. extern int (*SRC_src_reset)(SRC_STATE *state);
  37. extern SRC_STATE* (*SRC_src_delete)(SRC_STATE *state);
  38. extern const char* (*SRC_src_strerror)(int error);
  39. #endif
  40. /* Functions to get a list of "close" audio formats */
  41. extern SDL_AudioFormat SDL_FirstAudioFormat(SDL_AudioFormat format);
  42. extern SDL_AudioFormat SDL_NextAudioFormat(void);
  43. /* Function to calculate the size and silence for a SDL_AudioSpec */
  44. extern Uint8 SDL_SilenceValueForFormat(const SDL_AudioFormat format);
  45. extern void SDL_CalculateAudioSpec(SDL_AudioSpec * spec);
  46. /* Choose the audio filter functions below */
  47. extern void SDL_ChooseAudioConverters(void);
  48. /* These pointers get set during SDL_ChooseAudioConverters() to various SIMD implementations. */
  49. extern SDL_AudioFilter SDL_Convert_S8_to_F32;
  50. extern SDL_AudioFilter SDL_Convert_U8_to_F32;
  51. extern SDL_AudioFilter SDL_Convert_S16_to_F32;
  52. extern SDL_AudioFilter SDL_Convert_U16_to_F32;
  53. extern SDL_AudioFilter SDL_Convert_S32_to_F32;
  54. extern SDL_AudioFilter SDL_Convert_F32_to_S8;
  55. extern SDL_AudioFilter SDL_Convert_F32_to_U8;
  56. extern SDL_AudioFilter SDL_Convert_F32_to_S16;
  57. extern SDL_AudioFilter SDL_Convert_F32_to_U16;
  58. extern SDL_AudioFilter SDL_Convert_F32_to_S32;
  59. #endif /* SDL_audio_c_h_ */
  60. /* vi: set ts=4 sw=4 expandtab: */