open

fun open(sampleRate: Int, bufferFrames: Int, renderer: AudioRenderer): AudioDevice(source)

Opens the default playback device for float stereo at sampleRate frames per second and starts playing at once, calling renderer on SDL's audio thread for at most bufferFrames frames at a time. Pass the Int parameters by name.

bufferFrames is also passed to SDL as the device buffer size it should use, which sets the latency. SDL may pick a different size, and ignores the request when the hardware device is already open. sampleRate must be positive and bufferFrames in 1..65536.

Has no sample because it needs an audio device.

Throws

if sampleRate is not positive or bufferFrames is outside 1..65536.

if there is no playback device, the audio subsystem is not started, or SDL cannot open or start the device.