audio: SDL_OpenAudioDeviceStream() now allows a NULL spec.

This commit is contained in:
Ryan C. Gordon
2024-05-25 23:33:39 -04:00
parent 6a40a8eb12
commit 033793faed
2 changed files with 14 additions and 2 deletions

View File

@@ -1324,7 +1324,9 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyAudioStream(SDL_AudioStream *stream)
*
* The `spec` parameter represents the app's side of the audio stream. That
* is, for recording audio, this will be the output format, and for playing
* audio, this will be the input format.
* audio, this will be the input format. If spec is NULL, the system will
* choose the format, and the app can use SDL_GetAudioStreamFormat() to
* obtain this information later.
*
* If you don't care about opening a specific audio device, you can (and
* probably _should_), use SDL_AUDIO_DEVICE_DEFAULT_OUTPUT for playback and
@@ -1335,9 +1337,12 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyAudioStream(SDL_AudioStream *stream)
* capturing). Otherwise, the callback will begin to fire once the device is
* unpaused.
*
* Destroying the returned stream with SDL_DestroyAudioStream will also close
* the audio device associated with this stream.
*
* \param devid an audio device to open, or SDL_AUDIO_DEVICE_DEFAULT_OUTPUT or
* SDL_AUDIO_DEVICE_DEFAULT_CAPTURE.
* \param spec the audio stream's data format. Required.
* \param spec the audio stream's data format. Can be NULL.
* \param callback A callback where the app will provide new data for
* playback, or receive new data for capture. Can be NULL, in
* which case the app will need to call SDL_PutAudioStreamData