Documentation
¶
Overview ¶
Package main demonstrates multistream (surround) encoding and decoding.
Opus carries more than two channels by splitting the input into several elementary Opus streams (some coupled into stereo pairs, some mono) and describing the layout with a channel-mapping table. gopus exposes this through MultistreamEncoder / MultistreamDecoder.
For the standard Vorbis-style channel orders used by Ogg Opus (1-8 channels: mono, stereo, 3.0, quad, 5.0, 5.1, 6.1, 7.1) the *Default constructors pick the stream count, coupling, and mapping for you. This example encodes and decodes 5.1 surround that way, then prints the resulting stream layout.
Use the explicit NewMultistreamEncoder / NewMultistreamDecoder constructors when you need a custom mapping (for example >8 channels or a non-standard speaker order); see the package docs on those constructors for the mapping table format.
Usage:
go run ./examples/surround