Skip to main content

Module audio

Module audio 

Source
Expand description

WAV, BWF, RF64 and AIFF audio as a table of sample frames. The file is memory-mapped and a chunk walker finds the format and samples; row i is at data_offset + i * frame_bytes, so any window decodes from its own bytes (a 20 GB recording reads a screenful). Every stated length is checked against the file before use, so a hostile header errors rather than panics or over-allocates. The row count comes from the file size, letting a still-recording file grow ([AudioSource::extend]): recorders write a placeholder data size until they stop.

Structs§

AudioHeader
What the header says: the format, where the samples are, and everything else the Info panel shows.
AudioSource
An open audio file: its header and a map of its bytes, read a window at a time.
Marker
A marker or region from a cue (with LIST adtl labels) or MARK chunk.
SignalReport
What AudioSource::signal_report measured of one channel.

Enums§

Container
The container a file is.
Sample
How one sample is stored.

Constants§

CLIP_RUN
The shortest run of samples at full scale that counts as clipping. One sample there is a loud peak; three in a row is the waveform flattened against the limit.
FRAME
The name of the frame-number column.
SECONDS
The name of the column of each frame’s time from the start, in seconds. A float rather than a Duration: it charts, compares and reads as a plain number (12.345625), where a Duration displays as mixed units.

Functions§

detail
The Audio tab: the file’s format, size and length, then its metadata (bext, iXML, LIST INFO, AIFF text) and markers, markers last.
looks_like_audio
Whether the first bytes are a WAV, RF64, BW64 or AIFF file.
read_header
Read the header of a whole file’s bytes.