From ce46d4aa59cf04fa9f9d4515ff133903dbff95d3 Mon Sep 17 00:00:00 2001 From: dschlueter Date: Wed, 3 Jun 2026 21:12:49 +0200 Subject: [PATCH] =?UTF-8?q?Dokumentation:=20keep=5Faudio=20und=20GET=20/au?= =?UTF-8?q?dio/{job=5Fid}=20erg=C3=A4nzen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- BEDIENUNGSANLEITUNG.md | 14 ++++++++++++++ README.md | 15 +++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/BEDIENUNGSANLEITUNG.md b/BEDIENUNGSANLEITUNG.md index 32a63c9..0ab8095 100644 --- a/BEDIENUNGSANLEITUNG.md +++ b/BEDIENUNGSANLEITUNG.md @@ -202,6 +202,20 @@ curl -X POST http://COMPUTER-IP:9999/resume curl -X POST http://COMPUTER-IP:9999/stop ``` +**Audio-Datei herunterladen** (statt auf dem Server abspielen): +```bash +# 1. Auftrag erteilen mit keep_audio=true +JOB=$(curl -s -X POST http://COMPUTER-IP:9999/speak \ + -H "Content-Type: application/json" \ + -d '{"text": "Hallo Welt", "lang": "de", "keep_audio": true}' \ + | python3 -c "import sys,json; print(json.load(sys.stdin)['job_id'])") + +# 2. Warten bis fertig, dann herunterladen +sleep 40 +curl -o ausgabe.wav http://COMPUTER-IP:9999/audio/$JOB +``` +Die Datei wird nach dem Herunterladen automatisch gelöscht. + --- ## KI-Assistenten lassen vorlesen diff --git a/README.md b/README.md index 03a9787..d407124 100644 --- a/README.md +++ b/README.md @@ -160,6 +160,7 @@ journalctl --user -u chatterbox-tts -f | `POST` | `/stop` | Ausgabe abbrechen, Queue leeren | | `POST` | `/pause` | Ausgabe pausieren (ohne Datenverlust) | | `POST` | `/resume` | Pausierte Ausgabe fortsetzen | +| `GET` | `/audio/{job_id}` | Fertige WAV herunterladen (nur mit `keep_audio=true`) | | `GET` | `/health` | Service-Status und Gerät | | `GET` | `/status` | Aktueller Job, Queue-Länge, letzte Jobs | | `GET` | `/voices` | Unterstützte Sprachen | @@ -179,7 +180,8 @@ journalctl --user -u chatterbox-tts -f "save_wav": false, "output_path": null, "pronunciation_dict": null, - "session_id": null + "session_id": null, + "keep_audio": false } ``` @@ -199,6 +201,15 @@ curl -X POST http://localhost:9999/speak \ -H "Content-Type: application/json" \ -d '{"text": "Wichtiger Text", "lang": "de", "interrupt": true}' +# WAV-Datei erzeugen und herunterladen +JOB=$(curl -s -X POST http://localhost:9999/speak \ + -H "Content-Type: application/json" \ + -d '{"text": "Hallo Welt", "lang": "de", "keep_audio": true}' \ + | python3 -c "import sys,json; print(json.load(sys.stdin)['job_id'])") +sleep 40 # warten bis Synthese fertig +curl -o ausgabe.wav http://localhost:9999/audio/$JOB +# → WAV-Datei; wird nach dem Download automatisch gelöscht + # Pausieren und fortsetzen curl -X POST http://localhost:9999/pause curl -X POST http://localhost:9999/resume @@ -228,7 +239,7 @@ TTS_URL=http://192.168.1.10:9999 python mcp_adapter.py --stdio | Tool | Parameter | Funktion | |------|-----------|----------| -| `speak` | text, lang, voice, interrupt, speed, session_id | Text ausgeben | +| `speak` | text, lang, voice, interrupt, speed, session_id, keep_audio | Text ausgeben | | `stop` | — | Ausgabe stoppen und Queue leeren | | `pause` | — | Ausgabe pausieren (ohne Datenverlust) | | `resume` | — | Pausierte Ausgabe fortsetzen |