feat: Add VocoLoom Gradio WebUI, CLI speak_juergen tool, and Windows starter script
This commit is contained in:
1 parent
2a4bfea955
commit
bf244d2c82
4 files changed
+319
No files matched your search
@@ -0,0 +1,92 @@
|
||||
import os
|
||||
import sys
|
||||
import argparse
|
||||
|
||||
applio_dir = r"C:\GitHub\VocoLoom\Applio"
|
||||
sys.path.insert(0, applio_dir)
|
||||
os.chdir(applio_dir)
|
||||
|
||||
from core import run_tts_script
|
||||
|
||||
MODEL_PATH = r"C:\GitHub\VocoLoom\Applio\logs\Juergen_Seiferth\Juergen_Seiferth_300e_7800s.pth"
|
||||
INDEX_PATH = r"C:\GitHub\VocoLoom\Applio\logs\Juergen_Seiferth\Juergen_Seiferth.index"
|
||||
OUTPUT_DIR = r"C:\GitHub\VocoLoom"
|
||||
|
||||
def speak(text, mode="platz", output_file="juergen_speech.wav", play_audio=False):
|
||||
"""
|
||||
Synthesizes speech in Jürgen Seiferth's voice.
|
||||
mode: 'platz' (impulsiv, schnell, energisch) oder 'lkw' (stoisch, ruhig, brummig)
|
||||
"""
|
||||
if mode == "lkw":
|
||||
base_voice = "de-DE-ConradNeural"
|
||||
tts_rate = 5
|
||||
pitch = 0
|
||||
else: # platz
|
||||
base_voice = "de-DE-KillianNeural"
|
||||
tts_rate = 12
|
||||
pitch = 0
|
||||
|
||||
out_tts = os.path.join(OUTPUT_DIR, "temp_tts_base.wav")
|
||||
out_rvc = os.path.join(OUTPUT_DIR, output_file)
|
||||
|
||||
print(f"\n[VocoLoom] Jürgen Seiferth spricht (Modus: {mode.upper()}):")
|
||||
print(f'"{text}"')
|
||||
|
||||
run_tts_script(
|
||||
tts_file="",
|
||||
tts_text=text,
|
||||
tts_voice=base_voice,
|
||||
tts_rate=tts_rate,
|
||||
pitch=pitch,
|
||||
index_rate=0.75,
|
||||
volume_envelope=1.0,
|
||||
protect=0.33,
|
||||
f0_method="rmvpe",
|
||||
output_tts_path=out_tts,
|
||||
output_rvc_path=out_rvc,
|
||||
pth_path=MODEL_PATH,
|
||||
index_path=INDEX_PATH,
|
||||
f0_autotune=False,
|
||||
f0_autotune_strength=1.0,
|
||||
proposed_pitch=False,
|
||||
proposed_pitch_threshold=155.0,
|
||||
export_format="WAV",
|
||||
embedder_model="contentvec",
|
||||
embedder_model_custom=None,
|
||||
sid=0,
|
||||
formant_shifting=False,
|
||||
formant_qfrency=1.0,
|
||||
formant_timbre=1.0,
|
||||
cleanup_mode="off",
|
||||
cleanup_strength=12,
|
||||
)
|
||||
|
||||
print(f"[OK] Fertig generiert: {out_rvc}")
|
||||
|
||||
if play_audio:
|
||||
try:
|
||||
import winsound
|
||||
winsound.PlaySound(out_rvc, winsound.SND_FILENAME)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return out_rvc
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description="Lass Jürgen Seiferth beliebigen Text sprechen!")
|
||||
parser.add_argument("text", nargs="?", default=None, help="Der Text, den Jürgen sprechen soll")
|
||||
parser.add_argument("--mode", choices=["platz", "lkw"], default="platz", help="Stimm-Modus ('platz' = energisch/schnell, 'lkw' = ruhig/brummig)")
|
||||
parser.add_argument("--play", action="store_true", help="Audio nach Generierung sofort abspielen")
|
||||
parser.add_argument("--out", default="juergen_speech.wav", help="Dateiname für die Ausgabe-WAV")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if not args.text:
|
||||
print("=== VocoLoom: Jürgen Seiferth Text-to-Speech ===")
|
||||
user_input = input("Gib den Satz ein, den Jürgen sprechen soll:\n> ")
|
||||
if not user_input.strip():
|
||||
print("Kein Text eingegeben. Beende.")
|
||||
sys.exit(0)
|
||||
speak(user_input, mode=args.mode, output_file=args.out, play_audio=True)
|
||||
else:
|
||||
speak(args.text, mode=args.mode, output_file=args.out, play_audio=args.play)
|
||||
@@ -0,0 +1,10 @@
|
||||
@echo off
|
||||
title VocoLoom - Juergen Seiferth Voice Clone
|
||||
echo ============================================================
|
||||
echo VocoLoom: Juergen Seiferth (1995 Original Voice Clone)
|
||||
echo ============================================================
|
||||
echo Starte Web-Interface auf http://127.0.0.1:7865 ...
|
||||
cd /d "C:\GitHub\VocoLoom"
|
||||
call .venv\Scripts\activate.bat
|
||||
python webui.py
|
||||
pause
|
||||
@@ -0,0 +1,66 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
applio_dir = r"C:\GitHub\VocoLoom\Applio"
|
||||
sys.path.insert(0, applio_dir)
|
||||
os.chdir(applio_dir)
|
||||
|
||||
from core import run_tts_script
|
||||
|
||||
model_path = r"C:\GitHub\VocoLoom\Applio\logs\Juergen_Seiferth\Juergen_Seiferth_300e_7800s.pth"
|
||||
index_path = r"C:\GitHub\VocoLoom\Applio\logs\Juergen_Seiferth\Juergen_Seiferth.index"
|
||||
|
||||
# 1. Original User Text
|
||||
text_standard = (
|
||||
"Frag mal, ob du die Fotos vom Tobias bekommst. Wir haben keine gemacht. "
|
||||
"Aber nicht in die Gruppen rein senden! Der Kenny stellt es bloß wieder online!"
|
||||
)
|
||||
|
||||
# 2. Authentic Jürgen Slang (more natural phonetic flow)
|
||||
text_authentic = (
|
||||
"Frag ma, ob de die Fotos vom Tobias kriegst. Wir ham keene gemacht! "
|
||||
"Aber nich in die Gruppen neistellen... der Kenny stellt's bloß wieder online!"
|
||||
)
|
||||
|
||||
tests = [
|
||||
("test1_conrad_pitch0_standard", text_standard, "de-DE-ConradNeural", 0, 10),
|
||||
("test2_conrad_pitch0_slang", text_authentic, "de-DE-ConradNeural", 0, 10),
|
||||
("test3_florian_pitch0_slang", text_authentic, "de-DE-FlorianMultilingualNeural", 0, 10),
|
||||
("test4_killian_pitch0_slang", text_authentic, "de-DE-KillianNeural", 0, 10),
|
||||
]
|
||||
|
||||
for name, txt, voice, pitch, rate in tests:
|
||||
out_tts = os.path.join(r"C:\GitHub\VocoLoom", f"{name}_base.wav")
|
||||
out_rvc = os.path.join(r"C:\GitHub\VocoLoom", f"{name}_juergen.wav")
|
||||
print(f"Generating {name}...")
|
||||
run_tts_script(
|
||||
tts_file="",
|
||||
tts_text=txt,
|
||||
tts_voice=voice,
|
||||
tts_rate=rate,
|
||||
pitch=pitch,
|
||||
index_rate=0.75,
|
||||
volume_envelope=1.0,
|
||||
protect=0.33,
|
||||
f0_method="rmvpe",
|
||||
output_tts_path=out_tts,
|
||||
output_rvc_path=out_rvc,
|
||||
pth_path=model_path,
|
||||
index_path=index_path,
|
||||
f0_autotune=False,
|
||||
f0_autotune_strength=1.0,
|
||||
proposed_pitch=False,
|
||||
proposed_pitch_threshold=155.0,
|
||||
export_format="WAV",
|
||||
embedder_model="contentvec",
|
||||
embedder_model_custom=None,
|
||||
sid=0,
|
||||
formant_shifting=False,
|
||||
formant_qfrency=1.0,
|
||||
formant_timbre=1.0,
|
||||
cleanup_mode="off",
|
||||
cleanup_strength=12,
|
||||
)
|
||||
print(f"Generated: {out_rvc}")
|
||||
|
||||
print("All tests completed!")
|
||||
@@ -0,0 +1,151 @@
|
||||
import os
|
||||
import sys
|
||||
import gradio as gr
|
||||
|
||||
applio_dir = r"C:\GitHub\VocoLoom\Applio"
|
||||
sys.path.insert(0, applio_dir)
|
||||
os.chdir(applio_dir)
|
||||
|
||||
from core import run_tts_script, run_infer_script
|
||||
|
||||
MODEL_PATH = r"C:\GitHub\VocoLoom\Applio\logs\Juergen_Seiferth\Juergen_Seiferth_300e_7800s.pth"
|
||||
INDEX_PATH = r"C:\GitHub\VocoLoom\Applio\logs\Juergen_Seiferth\Juergen_Seiferth.index"
|
||||
OUTPUT_DIR = r"C:\GitHub\VocoLoom"
|
||||
|
||||
def tts_generate(text, mode, speed_boost):
|
||||
if not text.strip():
|
||||
return None, "Bitte gib einen Text ein."
|
||||
|
||||
rate = 12 if mode == "platz" else 5
|
||||
if speed_boost:
|
||||
rate += 10
|
||||
|
||||
base_voice = "de-DE-KillianNeural" if mode == "platz" else "de-DE-ConradNeural"
|
||||
out_tts = os.path.join(OUTPUT_DIR, "temp_web_tts.wav")
|
||||
out_rvc = os.path.join(OUTPUT_DIR, "temp_web_juergen.wav")
|
||||
|
||||
run_tts_script(
|
||||
tts_file="",
|
||||
tts_text=text,
|
||||
tts_voice=base_voice,
|
||||
tts_rate=rate,
|
||||
pitch=0,
|
||||
index_rate=0.75,
|
||||
volume_envelope=1.0,
|
||||
protect=0.33,
|
||||
f0_method="rmvpe",
|
||||
output_tts_path=out_tts,
|
||||
output_rvc_path=out_rvc,
|
||||
pth_path=MODEL_PATH,
|
||||
index_path=INDEX_PATH,
|
||||
f0_autotune=False,
|
||||
f0_autotune_strength=1.0,
|
||||
proposed_pitch=False,
|
||||
proposed_pitch_threshold=155.0,
|
||||
export_format="WAV",
|
||||
embedder_model="contentvec",
|
||||
embedder_model_custom=None,
|
||||
sid=0,
|
||||
formant_shifting=False,
|
||||
formant_qfrency=1.0,
|
||||
formant_timbre=1.0,
|
||||
cleanup_mode="off",
|
||||
cleanup_strength=12,
|
||||
)
|
||||
|
||||
return out_rvc, f"Erfolgreich generiert ({mode.upper()}, +{rate}% Tempo)"
|
||||
|
||||
def vc_convert(audio_path):
|
||||
if not audio_path:
|
||||
return None, "Bitte nimm Audio auf oder lade eine Datei hoch."
|
||||
|
||||
out_rvc = os.path.join(OUTPUT_DIR, "temp_web_vc_juergen.wav")
|
||||
run_infer_script(
|
||||
pitch=0,
|
||||
index_rate=0.75,
|
||||
volume_envelope=1.0,
|
||||
protect=0.33,
|
||||
f0_method="rmvpe",
|
||||
input_path=audio_path,
|
||||
output_path=out_rvc,
|
||||
pth_path=MODEL_PATH,
|
||||
index_path=INDEX_PATH,
|
||||
f0_autotune=False,
|
||||
f0_autotune_strength=1.0,
|
||||
proposed_pitch=False,
|
||||
proposed_pitch_threshold=155.0,
|
||||
export_format="WAV",
|
||||
embedder_model="contentvec",
|
||||
embedder_model_custom=None,
|
||||
formant_shifting=False,
|
||||
formant_qfrency=1.0,
|
||||
formant_timbre=1.0,
|
||||
sid=0,
|
||||
inference_engine=None,
|
||||
onnx_precision="auto",
|
||||
cleanup_mode="off",
|
||||
cleanup_strength=12,
|
||||
)
|
||||
return out_rvc, "Stimme erfolgreich in Jürgen Seiferth umgewandelt!"
|
||||
|
||||
with gr.Blocks(title="VocoLoom - Jürgen Seiferth Voice Clone") as demo:
|
||||
gr.Markdown("# 🎡 VocoLoom: Jürgen Seiferth (1995 Original)")
|
||||
gr.Markdown("*Breakdance-Schausteller-Stimme geklont aus MDR 'Die Welt ist unser Feld' (300 Epochen RVC + FAISS Index)*")
|
||||
|
||||
with gr.Tab("✍️ Text-to-Speech (Schreiben -> Jürgen spricht)"):
|
||||
with gr.Row():
|
||||
with gr.Column(scale=2):
|
||||
text_input = gr.Textbox(
|
||||
label="Text eingeben",
|
||||
placeholder="Schreib hier, was Jürgen sagen soll...",
|
||||
lines=3,
|
||||
value="Frag ma, ob de die Fotos vom Tobias kriegst! Wir ham keene gemacht. Aber nich in die Gruppen neistellen... der Kenny stellt's bloß wieder online!"
|
||||
)
|
||||
with gr.Row():
|
||||
mode_radio = gr.Radio(
|
||||
choices=[("🔥 Impulsiv / Auf dem Platz", "platz"), ("☕ Ruhig / LKW-Fahrerkabine", "lkw")],
|
||||
value="platz",
|
||||
label="Stimmung / Modus"
|
||||
)
|
||||
speed_check = gr.Checkbox(label="Schnelleres Sprechtempo (+10%)", value=False)
|
||||
|
||||
generate_btn = gr.Button("🎙️ Jürgen sprechen lassen", variant="primary")
|
||||
|
||||
gr.Examples(
|
||||
examples=[
|
||||
["Frag ma, ob de die Fotos vom Tobias kriegst! Wir ham keene gemacht. Aber nich in die Gruppen neistellen... der Kenny stellt's bloß wieder online!", "platz"],
|
||||
["Fertig Ballett oder was?! Mensch, da guckt man nicht zu, da packt man an!", "platz"],
|
||||
["Was soll mich aufregen? Eigentlich gar nicht. Von der Sache her lässt mich alles eiskalt. Hauptsache angekommen, stimmt's?!", "lkw"],
|
||||
["Pass mal auf! Was nicht ganz läuft so wie ich das will, das wird so gemacht, damit das läuft!", "platz"],
|
||||
],
|
||||
inputs=[text_input, mode_radio]
|
||||
)
|
||||
|
||||
with gr.Column(scale=1):
|
||||
audio_output = gr.Audio(label="Jürgen spricht:", type="filepath")
|
||||
status_box = gr.Textbox(label="Status", interactive=False)
|
||||
|
||||
generate_btn.click(
|
||||
tts_generate,
|
||||
inputs=[text_input, mode_radio, speed_check],
|
||||
outputs=[audio_output, status_box]
|
||||
)
|
||||
|
||||
with gr.Tab("🎤 Voice Changer (Mikrofon / Audio -> Jürgen)"):
|
||||
gr.Markdown("Sprich selbst ins Mikrofon (mit Dialekt/Betonung) oder lade Audio hoch – das Modell wandelt deine Stimme 1:1 in Jürgen Seiferth um!")
|
||||
with gr.Row():
|
||||
with gr.Column():
|
||||
audio_input = gr.Audio(label="Deine Stimme aufnehmen oder hochladen", type="filepath")
|
||||
convert_btn = gr.Button("🔄 In Jürgen umwandeln", variant="primary")
|
||||
with gr.Column():
|
||||
vc_output = gr.Audio(label="Ergebnis in Jürgens Stimme:", type="filepath")
|
||||
vc_status = gr.Textbox(label="Status", interactive=False)
|
||||
|
||||
convert_btn.click(
|
||||
vc_convert,
|
||||
inputs=[audio_input],
|
||||
outputs=[vc_output, vc_status]
|
||||
)
|
||||
|
||||
if __name__ == "__main__":
|
||||
demo.launch(server_name="127.0.0.1", server_port=7860, inbrowser=False)
|
||||
Reference in new issue
Block a user