From 7668cb8e27ee530977a833d0db4939a124a94721 Mon Sep 17 00:00:00 2001 From: JarbasAI <33701864+JarbasAl@users.noreply.github.com> Date: Sun, 31 Dec 2023 02:56:50 +0000 Subject: [PATCH] move utterance to query params (#19) fixes https://github.com/OpenVoiceOS/ovos-tts-plugin-piper/issues/16 --- ovos_tts_server/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ovos_tts_server/__init__.py b/ovos_tts_server/__init__.py index d54abcb..911bebb 100644 --- a/ovos_tts_server/__init__.py +++ b/ovos_tts_server/__init__.py @@ -37,6 +37,13 @@ def synth(utterance: str, request: Request): audio, phonemes = TTS.synth(utterance, **request.query_params) return FileResponse(audio.path) + @app.get("/v2/synthesize") + def synth(request: Request): + utterance = request.query_params["utterance"] + utterance = TTS.validate_ssml(utterance) + audio, phonemes = TTS.synth(utterance, **request.query_params) + return FileResponse(audio.path) + return app