mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-10-03 17:15:19 -07:00
fix(kokoro): trim trailing silence and run-on noise on short prompt synthesis (#960)
This commit is contained in:
committed by
capy-ai-staging[bot]
parent
b788dc383c
commit
615aeaeb35
@@ -369,6 +369,7 @@ def _get_non_qwen_tts_configs() -> list[ModelConfig]:
|
||||
engine="kokoro",
|
||||
hf_repo_id="hexgrad/Kokoro-82M",
|
||||
size_mb=350,
|
||||
needs_trim=True,
|
||||
languages=["en", "es", "fr", "hi", "it", "pt", "ja", "zh"],
|
||||
),
|
||||
]
|
||||
|
||||
@@ -288,7 +288,10 @@ class KokoroTTSBackend:
|
||||
# Return 1 second of silence as fallback
|
||||
return np.zeros(KOKORO_SAMPLE_RATE, dtype=np.float32), KOKORO_SAMPLE_RATE
|
||||
|
||||
audio = np.concatenate(audio_chunks)
|
||||
return audio.astype(np.float32), KOKORO_SAMPLE_RATE
|
||||
audio = np.concatenate(audio_chunks).astype(np.float32)
|
||||
from ..utils.audio import trim_tts_output
|
||||
|
||||
audio = trim_tts_output(audio, sample_rate=KOKORO_SAMPLE_RATE)
|
||||
return audio, KOKORO_SAMPLE_RATE
|
||||
|
||||
return await asyncio.to_thread(_generate_sync)
|
||||
|
||||
Reference in New Issue
Block a user