vllm.multimodal.media.audio ¶
Classes:
-
AudioEmbeddingMediaIO–Configuration values can be user-provided either by --media-io-kwargs or
-
AudioMediaIO–Configuration values can be user-provided either by --media-io-kwargs or
Functions:
-
load_audio_pyav–Load an audio file using PyAV (FFmpeg), returning float32 mono waveform.
-
load_audio_soundfile–Load audio via soundfile
AudioEmbeddingMediaIO ¶
Configuration values can be user-provided either by --media-io-kwargs or by the runtime API field "media_io_kwargs". Ensure proper validation and error handling.
Source code in vllm/multimodal/media/audio.py
AudioMediaIO ¶
Bases: MediaIO[tuple[NDArray, float]]
Configuration values can be user-provided either by --media-io-kwargs or by the runtime API field "media_io_kwargs". Ensure proper validation and error handling.
Source code in vllm/multimodal/media/audio.py
load_audio_pyav(path, *, sr=22050, mono=True) ¶
Load an audio file using PyAV (FFmpeg), returning float32 mono waveform.
Decodes the audio stream at its native sample rate. Channel reduction to mono is performed by averaging across channels. Resampling to a model-specific rate is left to the downstream :class:AudioResampler.
Parameters:
-
(path¶BytesIO | Path | str) –A :class:
~io.BytesIObuffer, a filesystem :class:~pathlib.Path, or a string path.
Returns:
-
NDArray–(waveform, sample_rate)where waveform is a 1-D float32 -
float–NumPy array and sample_rate is the native sample rate in Hz.
Source code in vllm/multimodal/media/audio.py
load_audio_soundfile(path, *, sr=22050, mono=True) ¶
Load audio via soundfile