From faee30278b8dea3f7be939c1dd59442c0ee1d73b Mon Sep 17 00:00:00 2001 From: Hoan Luu Huu <110280845+xquanluu@users.noreply.github.com> Date: Tue, 27 Jan 2026 20:18:47 +0700 Subject: [PATCH] support mod_google_tts_streaming (#1409) * support mod_google_tts_streaming * wip * wip --- lib/tasks/tts-task.js | 7 +++++++ lib/utils/constants.json | 5 +++++ lib/utils/tts-streaming-buffer.js | 1 + 3 files changed, 13 insertions(+) diff --git a/lib/tasks/tts-task.js b/lib/tasks/tts-task.js index 757eac42..4e4ea91a 100644 --- a/lib/tasks/tts-task.js +++ b/lib/tasks/tts-task.js @@ -157,6 +157,13 @@ class TtsTask extends Task { ...(reduceLatency && {RIMELABS_TTS_STREAMING_REDUCE_LATENCY: reduceLatency}) }; break; + case 'google': + obj = { + GOOGLE_TTS_LANGUAGE_CODE: language, + GOOGLE_TTS_VOICE_NAME: voice, + GOOGLE_APPLICATION_CREDENTIALS: JSON.stringify(credentials.credentials) + }; + break; default: if (vendor.startsWith('custom:')) { const use_tls = custom_tts_streaming_url.startsWith('wss://'); diff --git a/lib/utils/constants.json b/lib/utils/constants.json index f771d8d7..89203ac2 100644 --- a/lib/utils/constants.json +++ b/lib/utils/constants.json @@ -311,6 +311,11 @@ "ConnectFailure": "deepgram_tts_streaming::connect_failed", "Connect": "deepgram_tts_streaming::connect" }, + "GoogleTtsStreamingEvents": { + "Empty": "google_tts_streaming::empty", + "ConnectFailure": "google_tts_streaming::connect_failed", + "Connect": "google_tts_streaming::connect" + }, "CartesiaTtsStreamingEvents": { "Empty": "cartesia_tts_streaming::empty", "ConnectFailure": "cartesia_tts_streaming::connect_failed", diff --git a/lib/utils/tts-streaming-buffer.js b/lib/utils/tts-streaming-buffer.js index 44cf9c45..c8e62b55 100644 --- a/lib/utils/tts-streaming-buffer.js +++ b/lib/utils/tts-streaming-buffer.js @@ -421,6 +421,7 @@ class TtsStreamingBuffer extends Emitter { 'cartesia', 'elevenlabs', 'rimelabs', + 'google', 'custom' ].forEach((vendor) => { const eventClassName = `${vendor.charAt(0).toUpperCase() + vendor.slice(1)}TtsStreamingEvents`;