vllm.multimodal.media.audio ¶
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 ¶
load_audio_pyav(
path: BytesIO | Path | str,
*,
sr: float | None = 22050,
mono: bool = True,
) -> tuple[NDArray, float]
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:
| Name | Type | Description | Default |
|---|---|---|---|
path | BytesIO | Path | str | A :class: | required |
Returns:
| Type | Description |
|---|---|
NDArray |
|
float | NumPy array and sample_rate is the native sample rate in Hz. |
Source code in vllm/multimodal/media/audio.py
load_audio_soundfile ¶
load_audio_soundfile(
path: BytesIO | Path | str,
*,
sr: float | None = 22050,
mono: bool = True,
) -> tuple[ndarray, int]
Load audio via soundfile