2026-08-04 20:10:33 -07:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
2026-09-05 16:20:21 +08:00
|
|
|
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
|
2026-09-27 11:02:24 +08:00
|
|
|
"""PCM input framing for PersonaPlex: 24 kHz ``pcm_f32le`` into 1920-sample (80 ms) units."""
|
2026-08-04 20:10:33 -07:00
|
|
|
|
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
2026-09-27 11:02:24 +08:00
|
|
|
from vllm_omni.model_executor.common.duplex.pcm_buffer import FixedFramePcmAppendBuffer
|
|
|
|
|
from vllm_omni.model_executor.models.personaplex.duplex.config import (
|
|
|
|
|
CHUNK_PERIOD_MS,
|
|
|
|
|
FRAME_SIZE,
|
|
|
|
|
SAMPLE_RATE,
|
|
|
|
|
)
|
2026-08-04 20:10:33 -07:00
|
|
|
|
|
|
|
|
|
2026-09-27 11:02:24 +08:00
|
|
|
class PersonaPlexPcmAppendBuffer(FixedFramePcmAppendBuffer):
|
2026-08-04 20:10:33 -07:00
|
|
|
"""Transactionally frame 24 kHz float PCM into PersonaPlex 80 ms units."""
|
|
|
|
|
|
|
|
|
|
def __init__(self) -> None:
|
2026-09-27 11:02:24 +08:00
|
|
|
super().__init__(
|
|
|
|
|
sample_rate_hz=SAMPLE_RATE,
|
|
|
|
|
frame_samples=FRAME_SIZE,
|
|
|
|
|
chunk_period_ms=CHUNK_PERIOD_MS,
|
|
|
|
|
model="PersonaPlex",
|
2026-08-04 20:10:33 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
2026-09-27 11:02:24 +08:00
|
|
|
__all__ = ["PersonaPlexPcmAppendBuffer"]
|