AudioSourceFormatChanged

data class AudioSourceFormatChanged(val fromSampleRate: Int, val fromChannels: Int, val toSampleRate: Int, val toChannels: Int) : PlaybackWarning

The decoder started producing a different audio format part way through the same stream.

The player handles it: the conversion stage is keyed on what the decoder produces, so it is rebuilt on the buffer that changed and the device keeps the format it agreed to. The device is NOT reopened, which is deliberate. Reopening would gap the sound, and there is nothing to gain from it while the conversion is exact.

It is a warning because it is otherwise invisible. A stream that switches from 48 kHz to 44.1 kHz sounds the same and quietly adds a resampler for the rest of the file, and the only way anyone found out was by noticing it in a profile. Concatenated files and some broadcast captures do this.

Once per change, not once per buffer.

Constructors

Link copied to clipboard
constructor(fromSampleRate: Int, fromChannels: Int, toSampleRate: Int, toChannels: Int)

Properties

Link copied to clipboard
open override val fields: Map<String, String>

The warning as key and value pairs, for a structured log sink.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val message: String
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
override fun toString(): String

The type and the message, with every URI cut to its file name, as for PlaybackError.