Skip to main content

start_decode

Function start_decode 

Source
pub fn start_decode<N, F>(
    first: SourceEntry,
    producer: Producer<f32>,
    seek_ms: u64,
    next_track: N,
    timeline: Arc<PlaybackTimeline>,
    viz_buffer: Option<Arc<VizBuffer>>,
    rg_mode: ReplayGainMode,
    pre_amp_db: f64,
    on_finished: F,
) -> Result<(StreamInfo, DecodeHandle), DecodeError>
where N: Fn() -> Option<SourceEntry> + Send + 'static, F: FnOnce() + Send + 'static,
Expand description

Start decoding from a SourceEntry into the ring buffer.

first — the first track’s source entry. seek_ms — if > 0, seek to this position before decoding the first track. next_track — closure returning the next SourceEntry for gapless playback. Called on EOF. Returns None when the playlist is exhausted.