AudioSDL 3.2

SDL_BindAudioStream

Connects a stream to an opened device, so the device plays what you put into the stream.

Signature

bool SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_AudioStream *stream);

How it works

A device can have many streams bound; it mixes them all. A stream can be bound to only one device at a time. SDL_UnbindAudioStream disconnects it.

Parameters

devidSDL_AudioDeviceID

A device from SDL_OpenAudioDevice.

streamSDL_AudioStream *

The stream to connect.

Return value

true on success, false on failure.

Example

example.cpp
1SDL_BindAudioStream(dev, music);
2SDL_BindAudioStream(dev, sfx);
Official SDL wiki