AudioInfo

loader.AudioInfo(
    n_samples,
    sample_rate,
    channels,
    duration_seconds,
    format,
    subtype=None,
    bits_per_sample=None,
    source_path=None,
    extra=dict(),
)

Metadata for an audio file.

This dataclass holds all relevant information about an audio file that is needed to create a DiscretePhysicalTimeline.

Attributes

Name Type Description
n_samples int Total number of samples in the file (frames).
sample_rate int Sample rate in Hz (e.g., 44100, 48000).
channels int Number of audio channels (1=mono, 2=stereo).
duration_seconds float Duration in seconds (computed from n_samples/sample_rate).
format str Audio format/codec (e.g., “WAV”, “FLAC”, “MP3”).
subtype str | None Audio subtype/encoding (e.g., “PCM_16”, “PCM_24”, “VORBIS”).
bits_per_sample int | None Bit depth (e.g., 16, 24, 32). May be None for lossy formats.
source_path Path | None Path to the source file.
extra dict[str, Any] Additional format-specific metadata.