Package-level declarations
Types
Writes to an already-open session. Opening DacSession discovers and initializes its hardware volume without opening a stream or programming its clock. The host retains session ownership: closing a track output closes only its stream, so volume remains usable between tracks.
Puts the DAC's volume where Media3 looks for the device volume. A session whose player reports a remote device volume gives Android a volume provider, so the system volume panel and the hardware keys (also with the screen off) end up in the methods below. While no DAC volume is open the player behaves as the one it wraps, and the keys change the phone's volume.
An output the sink writes to: what the library returned, and what the sink needs to know about it.
Result from a cached, side-effect-free output capability snapshot.
A drained track's replacement, including a usable restored old format on rollback.
The output was lost after Media3 submitted audio. Seek the decoder before retrying.
What the audio sink needs from the app. The sink is written against this and PcmOutput, so a test can give it a fake output and no DAC.
The accepted producer format and, when known, the resulting target format.
How Media3's PCM maps onto what the output wants. Media3 hands over little-endian PCM in 1, 2, 3 or 4 bytes per sample. The output wants the layout of its dev.usbdac.WriteFormat: the same, or a wider slot with the sample left-justified (24 bits in a 4-byte slot is the sample shifted left by 8).
An AudioSink that plays Media3's decoded PCM through an OutputSource: direct USB when the DAC allows it, otherwise whatever the library's selector chose. It does no processing: no gain, no speed change, no silence skipping. Stereo and mono signed integer PCM, unsigned8 and IEEE float32.
Functions
Copies samples samples from source (from its position, which does not move) into target and pads each one to outputBytes bytes with zero low bytes. Widening keeps every sample value.