DacSessionOutputSource

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.

Only equal-rate/equal-channel Type I PCM is accepted. Unsigned8 and float32 retain exact bits. allowWidening permits a wider integer depth and zero-padded slots; the sink preserves every input bit. No resampling or narrowing occurs. DAC ducking is deliberately host-owned via volumeMultiplier, so the host can restore its level.

Constructors

Link copied to clipboard
constructor(session: DacSession, allowWidening: Boolean = true, volumeMultiplier: (Float) -> Unit = {})

Functions

Link copied to clipboard
open fun canRecover(error: DacException): Boolean

Whether this source can recreate an output after this typed failure and a decoder seek.

Link copied to clipboard
open override fun close(output: OpenedOutput)

Closes output and everything opened for it. Blocks.

Link copied to clipboard
open override fun formatSupport(request: StreamRequest): OutputSupport

Whether the sink should accept request, answered from cached capabilities only. Do not open, negotiate, or probe here. UsbDacAudioSink.getFormatSupport asks it for every raw PCM format.

Link copied to clipboard
open fun onRecoveryPosition(output: OpenedOutput?, positionUs: Long?)

Last sink position observed on the playback thread, or null after a flush/reconfiguration. This is an advisory recovery point, not proof of samples audible at the instant of loss.

Link copied to clipboard
open override fun open(request: StreamRequest): OpenedOutput

Opens the best output for request. Blocks for 100 ms or more: the sink calls it off the main thread.

Link copied to clipboard
open override fun reconfigure(output: OpenedOutput, request: StreamRequest): OutputReconfiguration?

Optional transactional format change after drain; null retains the close/open fallback.

Link copied to clipboard
open override fun setVolumeMultiplier(multiplier: Float)

Android's ducking and the app's own player volume, as a multiplier from 0 to 1.

Link copied to clipboard
open override fun takeLookAgain(): Boolean

True once if the settings or the devices changed since the last time the output was opened.