Skip to main content

encode_pcm_with_template

Function encode_pcm_with_template 

Source
pub fn encode_pcm_with_template(
    samples: &[i32],
    spec: PcmSpec,
    template: &[u8],
) -> Result<Vec<u8>, NcwError>
Expand description

Re-encode PCM using an existing NCW’s encoding choices. The template supplies opaque headers, block widths/flags, unused terminal deltas and padded tail samples. Active audio payloads are reconstructed from samples, never copied. Rejects unsupported flags, malformed framing and values that do not fit the template. Supports raw and delta blocks for mono/stereo PCM16/24. Does not clip, round or normalize samples.