This is new wiki software and old wiki content. It's a work in progress!
Here's the explanation.
Be gentle, report bugs, leave feedback on pages, or just edit them yourself! Thanks!

SDL Wiki


Use this function to shut down audio processing and close the audio device.


void SDL_CloseAudioDevice(SDL_AudioDeviceID dev)

Function Parameters


an audio device previously opened with SDL_OpenAudioDevice()

Code Examples

extern SDL_AudioSpec want;
SDL_AudioDeviceID devid = SDL_OpenAudioDevice(NULL, 0, &want, NULL, 0);
if (devid > 0) {
    SDL_PauseAudioDevice(devid, 0);
    SDL_Delay(5000);  // let audio callback run for 5 seconds.


The application should close open audio devices once they are no longer needed. Calling this function will wait until the device's audio callback is not running, release the audio hardware and then clean up internal state. No further audio will play from this device once this function returns.

The device ID is invalid as soon as the device is closed, and is eligible for reuse in a new SDL_OpenAudioDevice() call immediately.


CategoryAPI, CategoryAudio

[ edit | delete | history | feedback | raw ]

[ front page | index | search | recent changes | git repo | offline html ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.