opus_multistream.h(3)

🌸 opus_multistream.h 🌸

okay bestie, welcome to the Opus multistream header β€” this is the Opus reference implementation multistream API, and yes she is that girl πŸ’…. Sit down, grab a boba, we're going through every single function together, no skips, no cap.


✨ NAME ✨

opus_multistream.h β€” the Opus reference implementation multistream API. that's the whole vibe. it's a C header, it's giving "many streams, one file" πŸ¦‹


πŸŽ€ SYNOPSIS πŸŽ€

#include 'opus.h'

🌈 Macros 🌈

  • #define OPUS_MULTISTREAM_GET_ENCODER_STATE(x, y) β€” grabs the encoder state for one individual stream inside a multistream encoder. lowkey the key to the whole encoder kingdom πŸ”‘
  • #define OPUS_MULTISTREAM_GET_DECODER_STATE(x, y) β€” same energy but for the decoder side: gets the decoder state for an individual stream of a multistream decoder πŸ’–

πŸ¦‹ Typedefs πŸ¦‹

  • typedef struct OpusMSEncoder OpusMSEncoder β€” the Opus multistream encoder state. she's the main character πŸ‘‘
  • typedef struct OpusMSDecoder OpusMSDecoder β€” the Opus multistream decoder state. the other main character, they're a duo fr fr ✨

πŸ’œ Functions πŸ’œ

🎧 Multistream encoder functions 🎧

  • opus_int32 opus_multistream_encoder_get_size (int streams, int coupled_streams) β€” tells you how big an OpusMSEncoder structure is, so you know how much room to set aside 🫢
  • opus_int32 opus_multistream_surround_encoder_get_size (int channels, int mapping_family) β€” the surround-flavoured size-getter. it's the channels + mapping_family version, and yes she exists, she's just chillin' in the list 🌈
  • 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. one-stop shop, we love a two-for-one πŸ’…
  • 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) β€” the surround encoder's create function. note she takes mapping_family and hands you back streams, coupled_streams and mapping through pointers, so you get the deets after the fact πŸ‘€
  • int opus_multistream_encoder_init (OpusMSEncoder *st, opus_int32 Fs, int channels, int streams, int coupled_streams, const unsigned char *mapping, int application) β€” initializes a multistream encoder state that you already allocated yourself. DIY girlies rise 🧚
  • 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) β€” the surround version of the init-you-already-allocated situation. same deal, mapping_family in, streams/coupled_streams/mapping out through pointers ✨
  • int opus_multistream_encode (OpusMSEncoder *st, const opus_int16 *pcm, int frame_size, unsigned char *data, opus_int32 max_data_bytes) β€” encodes one multistream Opus frame πŸ”₯
  • int opus_multistream_encode24 (OpusMSEncoder *st, const opus_int32 *pcm, int frame_size, unsigned char *data, opus_int32 max_data_bytes) β€” also encodes a multistream Opus frame. yep, same description, different pcm type β€” she takes const opus_int32 *pcm and that's the whole plot πŸ’€
  • 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 that was allocated by opus_multistream_encoder_create(). clean up after yourself bestie, we don't do leaks here 🫧
  • int opus_multistream_encoder_ctl (OpusMSEncoder *st, int request,...) β€” runs a CTL function on a multistream Opus encoder. variadic, mysterious, iconic πŸŽ€

🎢 Multistream decoder functions 🎢

  • opus_int32 opus_multistream_decoder_get_size (int streams, int coupled_streams) β€” tells you the size of an OpusMSDecoder structure. same energy as her encoder sister, just decoder-flavoured πŸ’–
  • 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. she's ready out the gate ✨
  • int opus_multistream_decoder_init (OpusMSDecoder *st, opus_int32 Fs, int channels, int streams, int coupled_streams, const unsigned char *mapping) β€” initializes a decoder state object you already allocated. note: no application arg here, decoders don't need one πŸ¦‹
  • int opus_multistream_decode (OpusMSDecoder *st, const unsigned char *data, opus_int32 len, opus_int16 *pcm, int frame_size, int decode_fec) β€” decodes a multistream Opus packet πŸ”₯
  • int opus_multistream_decode24 (OpusMSDecoder *st, const unsigned char *data, opus_int32 len, opus_int32 *pcm, int frame_size, int decode_fec) β€” decodes a multistream Opus packet. again, same one-liner, different output type β€” opus_int32 *pcm this time πŸ™ˆ
  • int opus_multistream_decode_float (OpusMSDecoder *st, const unsigned char *data, opus_int32 len, float *pcm, int frame_size, int decode_fec) β€” decodes a multistream Opus packet with floating point output 🌸
  • int opus_multistream_decoder_ctl (OpusMSDecoder *st, int request,...) β€” runs a CTL function on a multistream Opus decoder πŸ’…
  • void opus_multistream_decoder_destroy (OpusMSDecoder *st) β€” frees an OpusMSDecoder allocated by opus_multistream_decoder_create(). say bye bye properly 🫢

πŸ’« Detailed Description πŸ’«

Opus reference implementation multistream API.

that's it, that's the description. short, sweet, does exactly what it says on the tin ✨


🌟 Author 🌟

Generated automatically by Doxygen for Opus from the source code.

so technically no human author wrote this β€” Doxygen did, straight off the source. respect the automation honestly πŸ€–πŸ’–


πŸŽ€ SEE ALSO πŸŽ€

not a single SEE ALSO in sight, bestie. this page stands alone, independent, main character energy, no supporting cast needed πŸ’…


okay that's the whole page, every macro, every typedef, every function signature, every one-liner, all of it, nothing dropped 🫢

this was Opus version 1.6.1, dated Thu Jan 29 2026 14:35:32, and it's the opus_multistream.h(3) manual page β€” thanks for reading bestie, go encode some streams, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from