[播放平滑修复]:完成可打断播报平滑播放,包含单输出流分块播放和TTS采样率保真

This commit is contained in:
mkbk
2026-06-18 12:21:01 +08:00
parent 7519725321
commit d7dbec5c29
5 changed files with 142 additions and 40 deletions
+10 -1
View File
@@ -1,6 +1,6 @@
from __future__ import annotations
from collections.abc import Iterable, Sequence
from collections.abc import Callable, Iterable, Sequence
from typing import Protocol
from .models import (
@@ -28,6 +28,15 @@ class AudioTransport(Protocol):
def play_pcm(self, segment: AudioSegment, interrupt: bool = False) -> PlaybackResult:
...
def play_pcm_chunks(
self,
segment: AudioSegment,
*,
chunk_ms: int,
after_chunk: Callable[[AudioSegment, int], bool] | None = None,
) -> PlaybackResult:
...
def flush_input(self) -> int:
...