---
name: "opus_multistream.h"
section: "3"
platform: "linux"
package: "libopus-doc"
version: "1.5.2-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/opus_multistream.h"
---

# opus\_multistream.h(3)

Opus reference implementation multistream API.

## NAME

opus\_multistream.h - Opus reference implementation multistream API.

## SYNOPSIS

`#include 'opus.h'`\

### Macros

\#define **OPUS\_MULTISTREAM\_GET\_ENCODER\_STATE**(x,  y)\
 Gets the encoder state for an individual stream of a multistream encoder.  #define **OPUS\_MULTISTREAM\_GET\_DECODER\_STATE**(x,  y)\
 Gets the decoder state for an individual stream of a multistream decoder.

### Typedefs

typedef struct **OpusMSEncoder** **OpusMSEncoder**\
 Opus multistream encoder state.  typedef struct **OpusMSDecoder** **OpusMSDecoder**\
 Opus multistream decoder state.

### Functions

**Multistream encoder functions**\

**opus\_int32** **opus\_multistream\_encoder\_get\_size** (int streams, int coupled\_streams)\
 Gets the size of an OpusMSEncoder structure.  **opus\_int32** **opus\_multistream\_surround\_encoder\_get\_size** (int channels, int mapping\_family)\
 **OpusMSEncoder** \* **opus\_multistream\_encoder\_create** (**opus\_int32** Fs, int channels, int streams, int coupled\_streams, const unsigned char \*mapping, int application, int \*error)\
 Allocates and initializes a multistream encoder state.  **OpusMSEncoder** \* **opus\_multistream\_surround\_encoder\_create** (**opus\_int32** Fs, int channels, int mapping\_family, int \*streams, int \*coupled\_streams, unsigned char \*mapping, int application, int \*error)\
 int **opus\_multistream\_encoder\_init** (**OpusMSEncoder** \*st, **opus\_int32** Fs, int channels, int streams, int coupled\_streams, const unsigned char \*mapping, int application)\
 Initialize a previously allocated multistream encoder state.  int **opus\_multistream\_surround\_encoder\_init** (**OpusMSEncoder** \*st, **opus\_int32** Fs, int channels, int mapping\_family, int \*streams, int \*coupled\_streams, unsigned char \*mapping, int application)\
 int **opus\_multistream\_encode** (**OpusMSEncoder** \*st, const **opus\_int16** \*pcm, int frame\_size, unsigned char \*data, **opus\_int32** max\_data\_bytes)\
 Encodes a multistream Opus frame.  int **opus\_multistream\_encode\_float** (**OpusMSEncoder** \*st, const float \*pcm, int frame\_size, unsigned char \*data, **opus\_int32** max\_data\_bytes)\
 Encodes a multistream Opus frame from floating point input.  void **opus\_multistream\_encoder\_destroy** (**OpusMSEncoder** \*st)\
 Frees an `OpusMSEncoder` allocated by **opus\_multistream\_encoder\_create()**.  int **opus\_multistream\_encoder\_ctl** (**OpusMSEncoder** \*st, int request,...)\
 Perform a CTL function on a multistream Opus encoder.

**Multistream decoder functions**\

**opus\_int32** **opus\_multistream\_decoder\_get\_size** (int streams, int coupled\_streams)\
 Gets the size of an `OpusMSDecoder` structure.  **OpusMSDecoder** \* **opus\_multistream\_decoder\_create** (**opus\_int32** Fs, int channels, int streams, int coupled\_streams, const unsigned char \*mapping, int \*error)\
 Allocates and initializes a multistream decoder state.  int **opus\_multistream\_decoder\_init** (**OpusMSDecoder** \*st, **opus\_int32** Fs, int channels, int streams, int coupled\_streams, const unsigned char \*mapping)\
 Initialize a previously allocated decoder state object.  int **opus\_multistream\_decode** (**OpusMSDecoder** \*st, const unsigned char \*data, **opus\_int32** len, **opus\_int16** \*pcm, int frame\_size, int decode\_fec)\
 Decode a multistream Opus packet.  int **opus\_multistream\_decode\_float** (**OpusMSDecoder** \*st, const unsigned char \*data, **opus\_int32** len, float \*pcm, int frame\_size, int decode\_fec)\
 Decode a multistream Opus packet with floating point output.  int **opus\_multistream\_decoder\_ctl** (**OpusMSDecoder** \*st, int request,...)\
 Perform a CTL function on a multistream Opus decoder.  void **opus\_multistream\_decoder\_destroy** (**OpusMSDecoder** \*st)\
 Frees an `OpusMSDecoder` allocated by **opus\_multistream\_decoder\_create()**.

## Detailed Description

Opus reference implementation multistream API.

## Author

Generated automatically by Doxygen for Opus from the source code.
