Skip to main content

background_audio_source

Function background_audio_source 

Source
pub(super) fn background_audio_source(
    local_path: Option<String>,
    stream_url: String,
    item_id: &str,
) -> MediaSource
Expand description

Pick the source for an audio-only handoff.

A downloaded file wins over the audio-only stream URL. No transcode or audio extraction is involved or wanted: the native backends already play a video container without decoding its video — the Linux MPV backend is configured with video: no, and ExoPlayer simply has no surface to render to when the item is MediaType::Audio. Producing a separate audio-only file would cost CPU and battery, need an encoder the project does not ship, and leave a second artifact to keep in step with the first.

TRACES: UR-071 | DR-128 | UT-119