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

A PcmFeeder as a FeedOutput: the real socket, the real clock, the format of the stream. More...

Inheritance diagram for de.yaacc.snapcast.feed.PcmFeederOutput:
Inheritance graph
Collaboration diagram for de.yaacc.snapcast.feed.PcmFeederOutput:
Collaboration graph

Public Member Functions

boolean write (byte[] data, int offset, int length)
 Hands over PCM.
 
void discard ()
 The audio handed over so far is stale (a seek, a stop, a flush of the player): drop what is waiting.
 
boolean isRunning ()
 False once the feed failed or was closed.
 
int getQueuedBytes ()
 Bytes that wait to be sent.
 
void close ()
 Stops the feed and closes the connection.
 
String statistics ()
 Counters for the log of a device test (chunks, silence, late chunks, re-anchors, dropped bytes): numbers only, never an address or a name.
 
- Public Member Functions inherited from de.yaacc.multiroom.feed.FeedOutput
- Public Member Functions inherited from de.yaacc.multiroom.feed.PcmSink

Static Public Attributes

static final FeedOutputFactory FACTORY
 Opens real feeders in SnapcastStreams#FORMAT.
 

Detailed Description

A PcmFeeder as a FeedOutput: the real socket, the real clock, the format of the stream.

Member Function Documentation

◆ close()

void de.yaacc.snapcast.feed.PcmFeederOutput.close ( )

Stops the feed and closes the connection.

May block for seconds: not on the main thread.

Implements de.yaacc.multiroom.feed.FeedOutput.

Here is the call graph for this function:

◆ discard()

void de.yaacc.snapcast.feed.PcmFeederOutput.discard ( )

The audio handed over so far is stale (a seek, a stop, a flush of the player): drop what is waiting.

Implements de.yaacc.multiroom.feed.PcmSink.

Here is the call graph for this function:

◆ getQueuedBytes()

int de.yaacc.snapcast.feed.PcmFeederOutput.getQueuedBytes ( )

Bytes that wait to be sent.

Implements de.yaacc.multiroom.feed.FeedOutput.

Here is the call graph for this function:

◆ isRunning()

boolean de.yaacc.snapcast.feed.PcmFeederOutput.isRunning ( )

False once the feed failed or was closed.

Implements de.yaacc.multiroom.feed.FeedOutput.

◆ statistics()

String de.yaacc.snapcast.feed.PcmFeederOutput.statistics ( )

Counters for the log of a device test (chunks, silence, late chunks, re-anchors, dropped bytes): numbers only, never an address or a name.

Implements de.yaacc.multiroom.feed.FeedOutput.

Here is the call graph for this function:

◆ write()

boolean de.yaacc.snapcast.feed.PcmFeederOutput.write ( byte[] data,
int offset,
int length )

Hands over PCM.

May wait for a short, bounded time when the sink is full (back pressure); never grows without limit. The data is copied before this returns.

Returns
false if the sink is closed or failed, or if (a part of) the data had to be dropped because the sink stayed full

Implements de.yaacc.multiroom.feed.PcmSink.

Here is the call graph for this function:

Member Data Documentation

◆ FACTORY

final FeedOutputFactory de.yaacc.snapcast.feed.PcmFeederOutput.FACTORY
static
Initial value:
= (address, port, onFailed) -> new PcmFeederOutput(
PcmFeeder.connect(address, port, SnapcastStreams.FORMAT, null, SocketFeedConnection.FACTORY, FeedClock.SYSTEM,
failure -> {
YaaccLogger.d(PcmFeederOutput.class.getName(), "feed connection failed: " + failure);
onFailed.run();
}))

Opens real feeders in SnapcastStreams#FORMAT.


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