openAudioDevice

Wraps Mix_OpenAudioDevice (from SDL_mixer 2.0.2) which opens a selected audio device for playback by SDL_mixer

@safe @trusted
static if(bindSDLMixer)
static if(sdlMixerSupport >= SDLMixerSupport.v2_0_2)
void
openAudioDevice
(,,,,
string deviceName
,
bool allowFrequencyChange = false
,
bool allowFormatChange = false
,
bool allowChannelsChange = false
,
bool allowSamplesChange = false
,
bool allowAnyChange = false
)

Parameters

frequency uint

audio playback frequency in Hz

format AudioFormat

dsdl2.AudioFormat enumeration indicating the scalar type of each audio sample

channels uint

channels for dsdl2.mixer.Chunk playback (1 for mono; 2 for stereo)

chunkSize uint

audio buffer size

deviceName string

name of the selected device

allowFrequencyChange bool

adds SDL_AUDIO_ALLOW_FREQUENCY_CHANGE flag

allowFormatChange bool

adds SDL_AUDIO_ALLOW_FORMAT_CHANGE flag

allowChannelsChange bool

adds SDL_AUDIO_ALLOW_CHANNELS_CHANGE flag

allowSamplesChange bool

adds SDL_AUDIO_ALLOW_SAMPLES_CHANGE flag (from SDL_mixer 2.0.9)

allowAnyChange bool

adds SDL_AUDIO_ALLOW_ANY_CHANGE flag

Throws

dsdl2.SDLException if failed to open the selected audio device

Meta