Example gallery
Short programs, grouped by task. The documentation build runs every one of them and fails if one raises or an assertion in it stops holding, so each plot and audio player below is the output of the code on its page. All signals are generated in the code, so a page can be copied and run with no audio files.
The longer explanations are in the tutorials. Each section below lists the notebooks that cover its topic. For the same tasks in Rust, see the gallery chapter of the crate’s book.
Loading and saving
Reading and writing WAV and FLAC files. See also the tutorial Quantisation and dither for what the sample types mean.
Spectrograms
Time-frequency representations. See also the tutorials The DFT, windows and leakage and STFT and spectrograms.
Mel and MFCC
Perceptual frequency scales and the features built on them. See also the tutorial Cepstrum, mel and MFCC and Psychoacoustics and codecs.
Pitch
Estimating the fundamental frequency. See also the tutorials Pitch: autocorrelation and YIN and LPC and formants.
Beats and onsets
Finding note starts and the pulse of a recording. See also the tutorial Onsets and tempo.
Separation
Splitting a signal into parts.
Effects
Dynamics, time and pitch changes, fades and silence. See also the tutorials Dynamics and Short-time energy, zero crossings and VAD.
Resampling
Changing the sample rate, alone or in a batch. See also the tutorials Sampling and aliasing and Resampling.
Filters
IIR filters and parametric EQ. See also the tutorials Convolution and FIR filters and IIR filters.
Plotting
audio_samples.mpl has ready-made Matplotlib figures for AudioSamples. It
needs pip install "audio_samples[mpl]". Every function accepts ax= to draw
into an existing figure and style= to change the look.