Change the input and output formats of an audio stream.
int SDL_SetAudioStreamFormat(SDL_AudioStream *stream,
SDL_AudioFormat src_format,int src_channels,
int src_rate,
SDL_AudioFormat dst_format,int dst_channels,
int dst_rate);
src_format | The format of the audio input |
src_channels | The number of channels of the audio input |
src_rate | The sampling rate of the audio input |
dst_format | The format of the desired audio output |
dst_channels | The number of channels of the desired audio output |
dst_rate | The sampling rate of the desired audio output |
Returns 0 on success, or -1 on error.
Future calls to and SDL_GetAudioStreamAvailable and SDL_GetAudioStreamData will reflect the new format, and future calls to SDL_PutAudioStreamData must provide data in the new input formats.
It is safe to call this function from any thread, as it holds a stream-specific mutex while running.
This function is available since SDL 3.0.0.