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

DRAFT of task 4.1: the Media3 processors that turn what ExoPlayer decodes into the format of the Snapcast stream and hand it to a PcmSink. More...

Collaboration diagram for de.yaacc.multiroom.feed.FeedTapChain:
Collaboration graph

Static Public Member Functions

static AudioProcessor[] create (PcmFormat target, PcmSink sink, boolean playLocally)
 A new chain (the processors keep state: one chain per player).
 

Detailed Description

DRAFT of task 4.1: the Media3 processors that turn what ExoPlayer decodes into the format of the Snapcast stream and hand it to a PcmSink.

Not wired into the player: task 4.4 waits for the owner's device.

The order matters:

  1. ToInt16PcmAudioProcessor (Media3): 8, 24, 32 bit and float to 16 bit. It is inactive for 16 bit.
  2. SonicAudioProcessor (Media3) with setOutputSampleRateHz: the sample rate, which is not written by hand. It accepts 16 bit and float only, hence the step before it, and is inactive when the rate matches.
  3. PcmTapAudioProcessor: folds the channels to stereo and hands the PCM over.

The Media3 ChannelMixingAudioProcessor is not used for the channels: its constant-power matrices exist for 1 to 6 channels only and it keeps a SparseArray, so it can not be tested on the JVM; PcmFormatConverter handles 1 to 8 channels with a documented, tested fold-down.

Use: new DefaultAudioSink.Builder(context).setAudioProcessors(FeedTapChain.create(...)).build() from the buildAudioSink of a DefaultRenderersFactory. Where in ExoPlayer's own pipeline these processors sit (before or after its channel mapping and trimming) is one of the questions of the device, see "Snapcast feed tap (draft)" in docs/tech.md.

Member Function Documentation

◆ create()

static AudioProcessor[] de.yaacc.multiroom.feed.FeedTapChain.create ( PcmFormat target,
PcmSink sink,
boolean playLocally )
static

A new chain (the processors keep state: one chain per player).

Parameters
targetthe format of the stream, rate included
sinkreceives the PCM
playLocallyfalse to mute the phone's own speaker

Referenced by de.yaacc.player.SendspinPlayer.createExoPlayer(), de.yaacc.player.SendspinSourcePlayer.createExoPlayer(), and de.yaacc.player.SnapcastPlayer.createExoPlayer().

Here is the caller graph for this function:

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