Skip to content

vllm_omni.model_executor.common.duplex.pcm_buffer

Transactional framing of client PCM into fixed model units.

A frame-locked model (PersonaPlex: 1920 samples every 80 ms at 24 kHz) takes exactly one frame per append. Clients send arbitrary chunks, so the session runner buffers them here and takes one whole frame out at a time as a reservation: committed once the stage accepted the append, rolled back (the bytes go back to the front of the buffer) when it did not.

FixedFramePcmAppendBuffer

Bases: PcmAppendBuffer

Frame pcm_f32le at one sample rate into frame_samples units, transactionally.

chunk_period_ms instance-attribute

chunk_period_ms = int(chunk_period_ms)

frame_bytes property

frame_bytes: int

frame_samples instance-attribute

frame_samples = int(frame_samples)

model instance-attribute

model = model

pending_byte_count property

pending_byte_count: int

sample_rate_hz instance-attribute

sample_rate_hz = int(sample_rate_hz)

clear

clear() -> None

clear_force_listen

clear_force_listen() -> None

flush

flush(*, chunk_period_ms: int) -> dict[str, object] | None

has_pending

has_pending() -> bool

has_reserved

has_reserved() -> bool

prepare_append

prepare_append(
    payload: dict[str, object],
    *,
    operation_id: str,
    chunk_period_ms: int,
    allow_emit: bool,
) -> FixedFramePcmAppendReservation | None

prepare_commit

prepare_commit(
    *, operation_id: str, chunk_period_ms: int
) -> FixedFramePcmAppendReservation

FixedFramePcmAppendReservation

Bases: PcmAppendReservation

active property

active: bool

byte_count property

byte_count: int

operation_id instance-attribute

operation_id = operation_id

payload instance-attribute

payload = payload

commit

commit() -> None

rollback

rollback() -> None