Skip to content

vllm_omni.utils.audio_resample

Streaming resampling, shared by the engine and the entrypoints.

Lives here rather than beside the OpenAI audio mixin because the duplex engine needs it too, and engine code must not import the entrypoints layer. Pure numpy on purpose: importing this must not pull in torch or the API server.

StreamingAudioResampler

Stateful polyphase resampler for streaming mono float audio.

Retains filter state so output is invariant to input chunk boundaries.

max_polyphase_factor class-attribute instance-attribute

max_polyphase_factor = 2048

scratch_bytes property

scratch_bytes: int

source_rate instance-attribute

source_rate = source_rate

target_rate instance-attribute

target_rate = target_rate

process

process(audio: ndarray, *, final: bool = False) -> ndarray

reset

reset() -> None