Warrior reference voice (deep, rough) for Chatterbox

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-09 21:39:35 +01:00
parent 0890bf025f
commit dab37de87a
2 changed files with 18 additions and 1 deletions

View File

@@ -5,7 +5,8 @@ Kokoro has clearly female / male English voices; a ~12 s calm sample of each is
enough for Chatterbox to take over the timbre in every language.
.venv-tts\\Scripts\\python.exe make_voice_refs.py
writes voice_refs/female.wav and voice_refs/male.wav
writes voice_refs/female.wav, voice_refs/male.wav and voice_refs/warrior.wav
(warrior: very deep, rough battle voice – Kokoro bm_lewis, −3 semitones, soft saturation)
"""
import _bootstrap # Projektordner (config.py, Listen) vor allen anderen Modulen
import config
@@ -25,6 +26,21 @@ TEXT = ("Once upon a time, in a quiet little town by the sea, a child was born.
VOICES = {"female": "af_heart", "male": "am_michael"}
WARRIOR_TEXT = ("Hear me, sons of Rome! I have bled in this sand for years. I have broken chains and broken men. "
"Tonight I fight, and tomorrow I will be free!")
def warrior():
import librosa
audio = np.concatenate([a.numpy() if hasattr(a, "numpy") else a
for _, _, a in KPipeline(lang_code="b")(WARRIOR_TEXT, voice="bm_lewis", speed=0.88)])
deep = librosa.effects.pitch_shift(audio.astype(np.float32), sr=24000, n_steps=-3)
deep = deep / (np.abs(deep).max() + 1e-6)
rough = np.tanh(deep * 2.6) / np.tanh(2.6) * 0.6 + deep * 0.4
path = os.path.join(OUT, "warrior.wav")
sf.write(path, rough * 0.9, 24000)
print(f"warrior: bm_lewis deep/rough, {len(audio) / 24000:.1f} s -> {path}")
def main():
os.makedirs(OUT, exist_ok=True)
@@ -35,6 +51,7 @@ def main():
path = os.path.join(OUT, f"{name}.wav")
sf.write(path, audio, 24000)
print(f"{name}: {voice}, {len(audio) / 24000:.1f} s -> {path}")
warrior()
if __name__ == "__main__":