load_audio#
Defined in: voxatlas.audio.loader
- voxatlas.audio.loader.load_audio(path, channel_mode='auto')[source]#
Load an audio/video file into one or more
Audioobjects.Supported inputs are
.wavand.mp4files. Multi-channel inputs can be kept as separate channels or mixed down to mono based onchannel_mode.- Parameters:
path (str) – Path to a
.wavaudio file or.mp4video file with an audio track.channel_mode (str) –
Channel handling strategy:
"auto": return mono as one item; stereo as two channel-split items; reject inputs with more than 2 channels."mono": average all channels into a single mono waveform."split": return oneAudioobject per input channel.
- Returns:
Loaded audio streams as
Audioobjects withfloat32waveforms.- Return type:
list[Audio]
Examples
>>> from voxatlas.audio.loader import load_audio >>> # Let the loader infer channel behavior (mono -> 1, stereo -> 2). >>> streams = load_audio("samples/example.wav") >>> # Force mono downmix. >>> mono = load_audio("samples/example.wav", channel_mode="mono")