函數原型:
SDL_AudioDeviceIDSDL_OpenAudioDevice(const char *device, int iscapture,
const SDL_AudioSpec * desired, SDL_AudioSpec * obtained,
int allowed_changes)
{
return open_audio_device(device, iscapture, desired, obtained, allowed_changes, 2);
}
static SDL_AudioDeviceIDopen_audio_device(const char *devname, int iscapture,
const SDL_AudioSpec * desired, SDL_AudioSpec * obtained,
int allowed_changes, int min_id);
SDL_OpenAudioDevice和SDL_OpenAudio函數都是通過調用open_audio_device來實現打開Audio device的操作的,
所以SDL2爲了與SDL1.x兼容,SDL_OpenAudioDevice函數只能用來打開AudioDeviceID大於等於2的設備,
而默認的設備,即AudioDeviceID等於1,只能用SDL_OpenAudio函數打開。