- Expanded package inclusion in `pyproject.toml` to support new modules. - Introduced new `adapters` and `protocol` packages for better organization. - Added backend adapter implementations for control plane integration. - Updated main application imports to reflect new package structure. - Removed deprecated core components and adjusted documentation accordingly. - Enhanced architecture documentation to clarify the new runtime and integration layers.
16 lines
447 B
Python
16 lines
447 B
Python
"""TTS flow helpers extracted from the duplex pipeline.
|
|
|
|
This module is intentionally lightweight for phase-wise migration.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from providers.common.base import TTSChunk
|
|
|
|
|
|
def chunk_duration_ms(chunk: TTSChunk) -> float:
|
|
"""Estimate chunk duration in milliseconds for pcm16 mono."""
|
|
if chunk.sample_rate <= 0:
|
|
return 0.0
|
|
return (len(chunk.audio) / 2.0 / float(chunk.sample_rate)) * 1000.0
|