The CodecHeader of the codec opus as the Snapcast server writes it: 12 bytes, little endian: the magic 0x4F505553, the sample rate, the bits per sample and the channels.
More...
|
|
int | getSampleRate () |
| |
|
int | getBitsPerSample () |
| |
|
int | getChannels () |
| |
|
byte[] | toOpusHead () |
| | The OpusHead of RFC 7845 for the platform decoder (csd-0): version 1, the channels, pre-skip 0 (the packets are played as they come, as the Snapcast client does), the input rate, no gain, channel mapping family 0.
|
| |
|
| static OpusHeader | parse (byte[] header) throws StreamFormatException |
| |
|
static byte[] | build (long sampleRate, int bitsPerSample, int channels) |
| | The 12 bytes for these values (no check: the reader decides what it accepts).
|
| |
|
static byte[] | nanosLittleEndian (long nanos) |
| | A number of nanoseconds as 8 bytes little endian, the form of csd-1 (pre-skip) and csd-2 (pre-roll).
|
| |
|
|
static final int | LENGTH = 12 |
| |
The CodecHeader of the codec opus as the Snapcast server writes it: 12 bytes, little endian: the magic 0x4F505553, the sample rate, the bits per sample and the channels.
A chunk is one Opus packet. The encoder of Snapcast always writes 48000, 16 and 2; the platform decoder outputs 48000 Hz 16 bit, so this is the format that is accepted (mono too: a packet may hold one channel).
◆ parse()
- Exceptions
-
| StreamFormatException | BAD_LENGTH for another length than 12, MALFORMED for another magic number, UNSUPPORTED_FORMAT for a format other than 48000 Hz, 16 bit, one or two channels |
The documentation for this class was generated from the following file:
- /github/workspace/yaacc/src/main/java/de/yaacc/multiroom/codec/OpusHeader.java