Function openAudioDevice

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

void openAudioDevice (
  uint frequency,
  AudioFormat format,
  uint channels,
  uint chunkSize,
  string deviceName,
  bool allowFrequencyChange = false,
  bool allowFormatChange = false,
  bool allowChannelsChange = false,
  bool allowSamplesChange = false,
  bool allowAnyChange = false
) @trusted;

Parameters

NameDescription
frequency audio playback frequency in Hz
format dsdl2.AudioFormat enumeration indicating the scalar type of each audio sample
channels channels for Chunk playback (1 for mono; 2 for stereo)
chunkSize audio buffer size
deviceName name of the selected device
allowFrequencyChange adds SDL_AUDIO_ALLOW_FREQUENCY_CHANGE flag
allowFormatChange adds SDL_AUDIO_ALLOW_FORMAT_CHANGE flag
allowChannelsChange adds SDL_AUDIO_ALLOW_CHANNELS_CHANGE flag
allowSamplesChange adds SDL_AUDIO_ALLOW_SAMPLES_CHANGE flag (from SDL_mixer 2.0.9)
allowAnyChange adds SDL_AUDIO_ALLOW_ANY_CHANGE flag

Throws

dsdl2.SDLException if failed to open the selected audio device