YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.multiroom.codec.CodecHeader Class Reference

The codec and the header that initialises its decoder, whatever protocol the stream comes from (shared by Snapcast and Sendspin). More...

Inheritance diagram for de.yaacc.multiroom.codec.CodecHeader:
Inheritance graph
Collaboration diagram for de.yaacc.multiroom.codec.CodecHeader:
Collaboration graph

Public Member Functions

Codec getCodec ()
 
byte[] getPayload ()
 A copy of the header, to initialise the decoder with.
 
WaveFormat getWaveFormat ()
 The parsed WAVE header; null for another codec.
 
FlacStreamInfo getFlacStreamInfo ()
 The parsed STREAMINFO; null for another codec.
 
OpusHeader getOpusHeader ()
 The parsed Opus header; null for another codec.
 
VorbisHeaders getVorbisHeaders ()
 The parsed Vorbis headers; null for another codec.
 
int getSampleRate ()
 
int getChannels ()
 
int getBitsPerSample ()
 The sample size of the PCM that comes out of the decoder (16 for the codecs opus and ogg).
 
boolean equals (Object other)
 
int hashCode ()
 

Static Public Member Functions

static CodecHeader of (Codec codec, byte[] header)
 
static CodecHeader parse (Codec codec, byte[] header) throws StreamFormatException
 

Protected Member Functions

 CodecHeader (Codec codec, byte[] payload, WaveFormat pcmFormat, FlacStreamInfo flacStreamInfo, OpusHeader opusHeader, VorbisHeaders vorbisHeaders)
 
 CodecHeader (CodecHeader other)
 For a subclass that adds a wire format: the same description.
 

Detailed Description

The codec and the header that initialises its decoder, whatever protocol the stream comes from (shared by Snapcast and Sendspin).

Only the codecs of the allow-list (Codec) exist, and the header is validated when the message is made, so a CodecHeader always describes a stream the engine supports: getSampleRate(), getChannels() and getBitsPerSample() are inside the ranges.

Member Function Documentation

◆ of()

static CodecHeader de.yaacc.multiroom.codec.CodecHeader.of ( Codec codec,
byte[] header )
static
Exceptions
IllegalArgumentExceptionwhen the header is not a valid header of that codec

Reimplemented in de.yaacc.snapcast.protocol.CodecHeaderMessage.

Referenced by de.yaacc.snapcast.protocol.CodecHeaderMessage.of(), and de.yaacc.sendspin.player.SendspinAudioEngine.start().

Here is the caller graph for this function:

The documentation for this class was generated from the following file: