Skip to main content

Module waveform

Module waveform 

Source
Expand description

Audio waveform generation.

This module provides WaveformOptions and WaveformData for generating waveform data suitable for visualisation. Audio samples are decoded, downmixed to mono, and bucketed into a configurable number of bins, with min/max/RMS values per bin.

§Example

use unbundle::{MediaFile, UnbundleError, WaveformOptions};

let mut unbundler = MediaFile::open("input.mp4")?;
let config = WaveformOptions::new().bins(800);
let waveform = unbundler.audio().generate_waveform(&config)?;
println!("Bins: {}", waveform.bins.len());

Structs§

WaveformBin
A single waveform bin containing amplitude statistics.
WaveformData
Waveform data produced by AudioHandle::generate_waveform.
WaveformOptions
Configuration for waveform generation.