include/SDL_audio.h
changeset 2866 e532417a6977
parent 2859 99210400e8b9
child 3021 f3dcf04412cf
equal deleted inserted replaced
2865:09adf4854163 2866:e532417a6977
   127 #define AUDIO_S16SYS	AUDIO_S16MSB
   127 #define AUDIO_S16SYS	AUDIO_S16MSB
   128 #define AUDIO_S32SYS	AUDIO_S32MSB
   128 #define AUDIO_S32SYS	AUDIO_S32MSB
   129 #define AUDIO_F32SYS	AUDIO_F32MSB
   129 #define AUDIO_F32SYS	AUDIO_F32MSB
   130 #endif
   130 #endif
   131 
   131 
       
   132 /* Which audio format changes are allowed when opening a device */
       
   133 #define SDL_AUDIO_ALLOW_FREQUENCY_CHANGE    0x00000001
       
   134 #define SDL_AUDIO_ALLOW_FORMAT_CHANGE       0x00000002
       
   135 #define SDL_AUDIO_ALLOW_CHANNELS_CHANGE     0x00000004
       
   136 #define SDL_AUDIO_ALLOW_ANY_CHANGE          (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE|SDL_AUDIO_ALLOW_FORMAT_CHANGE|SDL_AUDIO_ALLOW_CHANNELS_CHANGE)
   132 
   137 
   133 /* A structure to hold a set of audio conversion filters and buffers */
   138 /* A structure to hold a set of audio conversion filters and buffers */
   134 struct SDL_AudioCVT;
   139 struct SDL_AudioCVT;
   135 typedef void (SDLCALL * SDL_AudioFilter) (struct SDL_AudioCVT * cvt,
   140 typedef void (SDLCALL * SDL_AudioFilter) (struct SDL_AudioCVT * cvt,
   136                                           SDL_AudioFormat format);
   141                                           SDL_AudioFormat format);
   215  * be enabled for playing by calling SDL_PauseAudio(0) when you are ready
   220  * be enabled for playing by calling SDL_PauseAudio(0) when you are ready
   216  * for your audio callback function to be called.  Since the audio driver
   221  * for your audio callback function to be called.  Since the audio driver
   217  * may modify the requested size of the audio buffer, you should allocate
   222  * may modify the requested size of the audio buffer, you should allocate
   218  * any local mixing buffers after you open the audio device.
   223  * any local mixing buffers after you open the audio device.
   219  */
   224  */
   220 extern DECLSPEC int SDLCALL SDL_OpenAudio(const SDL_AudioSpec * desired,
   225 extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec * desired,
   221                                           SDL_AudioSpec * obtained);
   226                                           SDL_AudioSpec * obtained);
   222 
   227 
   223 /*
   228 /*
   224  * SDL Audio Device IDs.
   229  * SDL Audio Device IDs.
   225  * A successful call to SDL_OpenAudio() is always device id 1, and legacy
   230  * A successful call to SDL_OpenAudio() is always device id 1, and legacy
   275                                                               int iscapture,
   280                                                               int iscapture,
   276                                                               const
   281                                                               const
   277                                                               SDL_AudioSpec *
   282                                                               SDL_AudioSpec *
   278                                                               desired,
   283                                                               desired,
   279                                                               SDL_AudioSpec *
   284                                                               SDL_AudioSpec *
   280                                                               obtained);
   285                                                               obtained,
       
   286                                                               int
       
   287                                                               allowed_changes);
   281 
   288 
   282 
   289 
   283 
   290 
   284 /*
   291 /*
   285  * Get the current audio state:
   292  * Get the current audio state: