YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.snapcast.server.OpusChunkEncoder Class Reference

The opus codec of a stream: the CodecHeader of the Snapcast server (48000 Hz, 16 bit, stereo), every chunk of 20 ms is one Opus packet. More...

Inheritance diagram for de.yaacc.snapcast.server.OpusChunkEncoder:
Inheritance graph
Collaboration diagram for de.yaacc.snapcast.server.OpusChunkEncoder:
Collaboration graph

Public Member Functions

 OpusChunkEncoder (OpusPacketEncoder platform)
 
CodecHeaderMessage header ()
 The CodecHeader that a client gets first.
 
byte[] encode (byte[] pcm)
 The payload of the chunk for these PCM bytes (a whole chunk), or null when there is none (the chunk is left out).
 
void close ()
 Frees what the encoder holds (a platform encoder); called when its stream ends.
 
- Public Member Functions inherited from de.yaacc.snapcast.server.ChunkEncoder

Static Public Member Functions

static boolean platformHasEncoder (int sdkInt)
 True when the platform of this API level has an Opus encoder (the device may still lack it: the factory says).
 

Detailed Description

The opus codec of a stream: the CodecHeader of the Snapcast server (48000 Hz, 16 bit, stereo), every chunk of 20 ms is one Opus packet.

The platform's encoder exists from API 29 (Android 10); on an older device the stream is refused when it is added.

Member Function Documentation

◆ close()

void de.yaacc.snapcast.server.OpusChunkEncoder.close ( )

Frees what the encoder holds (a platform encoder); called when its stream ends.

Safe to call twice.

Implements de.yaacc.snapcast.server.ChunkEncoder.

Here is the call graph for this function:

◆ encode()

byte[] de.yaacc.snapcast.server.OpusChunkEncoder.encode ( byte[] pcm)

The payload of the chunk for these PCM bytes (a whole chunk), or null when there is none (the chunk is left out).

Called by the thread of the stream only.

Implements de.yaacc.snapcast.server.ChunkEncoder.

Here is the call graph for this function:

◆ header()

CodecHeaderMessage de.yaacc.snapcast.server.OpusChunkEncoder.header ( )

The CodecHeader that a client gets first.

Implements de.yaacc.snapcast.server.ChunkEncoder.


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