Skip to main content

build_audio_decode_args

Function build_audio_decode_args 

Source
pub fn build_audio_decode_args(
    source: &Path,
    sample_rate: u32,
    channels: u8,
) -> Vec<String>
Expand description

Build the gst-launch-1.0 argv that decodes source’s audio track to raw interleaved F32LE on stdout at sample_rate / channels (ED.21).

The edited export has no .f32 scratch at edit time (the audio lives inside the source MP4), so the per-segment retime can’t be expressed as a live capture. Instead we decode the whole source audio to raw samples with this one pass, slice + retime it per the project’s segments in pure Rust (screen_app::editor_export::retime_audio), then feed the result to the encoder’s audio scratch via VideoEncoder::push_audio_chunk — so the existing build_remux_args finalize muxes it exactly as for a live recording. GStreamer owns the intake; Rust owns the edit arithmetic.

Shape: -q filesrc location=SRC ! decodebin ! audioconvert ! audioresample ! audio/x-raw,format=F32LE,rate=R,channels=C,layout=interleaved ! fdsink fd=1 — the input mirror of the fdsink fd=1 decode pattern the decode crate uses for video.