---
name: "SDL_BindAudioStreams"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_BindAudioStreams"
---

# SDL\_BindAudioStreams(3)

Bind a list of audio streams to an audio device.

## NAME

SDL\_BindAudioStreams - Bind a list of audio streams to an audio device.

## HEADER FILE

Defined in SDL3/SDL\_audio.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**bool SDL\_BindAudioStreams(SDL\_AudioDeviceID devid, SDL\_AudioStream \* const \*streams, int num\_streams);**

## DESCRIPTION

Audio data will flow through any bound streams. For a playback device, data for all bound streams will be mixed together and fed to the device. For a recording device, a copy of recorded data will be provided to each bound stream.

Audio streams can only be bound to an open device. This operation is atomic--all streams bound in the same call will start processing at the same time, so they can stay in sync. Also: either all streams will be bound or none of them will be.

It is an error to bind an already-bound stream; it must be explicitly unbound first.

Binding a stream to a device will set its output format for playback devices, and its input format for recording devices, so they match the device's settings. The caller is welcome to change the other end of the stream's format at any time with

**SDL\_SetAudioStreamFormat** ().

## FUNCTION PARAMETERS

- *devid*

  an audio device to bind a stream to.

- *streams*

  an array of audio streams to bind.

- *num\_streams*

  number streams listed in the **streams** array.

## RETURN VALUE

Returns true on success or false on failure; call

**SDL\_GetError** () for more information.

## THREAD SAFETY

It is safe to call this function from any thread.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_BindAudioStreams**(3)](/SDL_BindAudioStreams/3.md), **•**(3), [**SDL\_UnbindAudioStream**(3)](/SDL_UnbindAudioStream/3.md), **•**(3), [**SDL\_GetAudioStreamDevice**(3)](/SDL_GetAudioStreamDevice/3.md)
