From a8a35c2e97187bd0bbc61568be940ebd77355e11 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 25 Aug 2026 08:40:27 +0000 Subject: [PATCH 1/3] Add Edge TTS generic output module --- config/modules/edgetts-generic.conf | 26 ++++++++++++++++++++++++++ src/modules/generic.c | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 config/modules/edgetts-generic.conf diff --git a/config/modules/edgetts-generic.conf b/config/modules/edgetts-generic.conf new file mode 100644 index 000000000..fc334bad6 --- /dev/null +++ b/config/modules/edgetts-generic.conf @@ -0,0 +1,26 @@ +Debug 1 + +GenericDefaultCharset "utf-8" + +GenericLanguage "en-US" "en-US" "utf-8" +GenericLanguage "hi-IN" "hi-IN" "utf-8" +GenericLanguage "bn-IN" "bn-IN" "utf-8" +GenericLanguage "gu-IN" "gu-IN" "utf-8" + +AddVoice "en-US" "MALE1" "en-US-AndrewNeural" +AddVoice "en-US" "MALE2" "en-US-BrianNeural" +AddVoice "en-US" "FEMALE1" "en-US-EmmaNeural" +AddVoice "en-US" "FEMALE2" "en-US-AriaNeural" + +AddVoice "hi-IN" "MALE1" "hi-IN-MadhurNeural" +AddVoice "hi-IN" "FEMALE1" "hi-IN-SwaraNeural" + +AddVoice "bn-IN" "MALE1" "bn-IN-PrabhatNeural" +AddVoice "bn-IN" "FEMALE1" "bn-IN-TanishaaNeural" + +AddVoice "gu-IN" "MALE1" "gu-IN-NiranjanNeural" +AddVoice "gu-IN" "FEMALE1" "gu-IN-DhwaniNeural" + +DefaultVoice "en-US-EmmaNeural" + +GenericExecuteSynth "/root/bin/speechd-edge-wrapper \"$DATA\" >/dev/null 2>&1" diff --git a/src/modules/generic.c b/src/modules/generic.c index 9ab8c94cd..c4299e188 100644 --- a/src/modules/generic.c +++ b/src/modules/generic.c @@ -650,7 +650,7 @@ void _generic_child(TModuleDoublePipe dpipe, const size_t maxlen) exit(EXIT_FAILURE); } else if (pid == 0) { // child, execute command - ret = execl("/bin/sh", "sh", "-c", command, (char *) NULL); + ret = execl("/bin/bash", "bash", "-c", command, (char *) NULL); // catch missing sh DBG("Missing /bin/sh? (ret=%d error=%d) %s", ret, errno, strerror(errno)); exit(EXIT_FAILURE); From acf685b74792e7ea6a85e190b4d956f053f71452 Mon Sep 17 00:00:00 2001 From: Jyatin Singh Date: Wed, 26 Aug 2026 23:48:02 +0530 Subject: [PATCH 2/3] fix: use edge-tts directly in generic module --- config/modules/edgetts-generic.conf | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/config/modules/edgetts-generic.conf b/config/modules/edgetts-generic.conf index fc334bad6..9f336dd13 100644 --- a/config/modules/edgetts-generic.conf +++ b/config/modules/edgetts-generic.conf @@ -1,7 +1,19 @@ -Debug 1 +# Edge TTS generic output module for Speech Dispatcher. +# It uses the edge-tts command-line client to synthesize speech +# and the generic module to play the resulting audio. + +# Debug turns debugging on or off +# See speechd.conf for information where debugging information is stored +Debug 0 GenericDefaultCharset "utf-8" +GenericExecuteSynth \ +"printf %s \'$DATA\' >$TMPDIR/edge-tts.txt && edge-tts -f $TMPDIR/edge-tts.txt -v \'$VOICE\' --write-media $TMPDIR/edge-tts.mp3 && $PLAY_COMMAND $TMPDIR/edge-tts.mp3" + +GenericCmdDependency "edge-tts" +GenericSoundIconFolder "/usr/share/sounds/sound-icons/" + GenericLanguage "en-US" "en-US" "utf-8" GenericLanguage "hi-IN" "hi-IN" "utf-8" GenericLanguage "bn-IN" "bn-IN" "utf-8" @@ -23,4 +35,9 @@ AddVoice "gu-IN" "FEMALE1" "gu-IN-DhwaniNeural" DefaultVoice "en-US-EmmaNeural" -GenericExecuteSynth "/root/bin/speechd-edge-wrapper \"$DATA\" >/dev/null 2>&1" +# Copyright (C) 2026 Jyatin Singh +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. From 2526c87c4b7941dfb95854a994c88b8179bbb7ba Mon Sep 17 00:00:00 2001 From: Jyatin Singh Date: Mon, 31 Aug 2026 23:34:39 +0530 Subject: [PATCH 3/3] fix: use mpg123 for Edge TTS audio output --- README.md | 1 + config/modules/Makefile.am | 2 ++ config/modules/edgetts-generic.conf | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a8c6dd5b7..9b361780b 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ These speech syntheses are supported: - Baratinoo / VoxyGen - Cicero - DECTalk +- Edge TTS - Epos - ESpeak/ESpeak-NG - Festival diff --git a/config/modules/Makefile.am b/config/modules/Makefile.am index 30cf2900b..5c89fe228 100644 --- a/config/modules/Makefile.am +++ b/config/modules/Makefile.am @@ -20,6 +20,7 @@ dist_moduleconf_DATA = cicero.conf espeak.conf espeak-ng.conf espeak-ng-mbrola.conf festival.conf \ flite.conf dtk-generic.conf \ epos-generic.conf \ + edgetts-generic.conf \ espeak-ng-mbrola-generic.conf espeak-mbrola-generic.conf \ llia_phon-generic.conf \ swift-generic.conf mary-generic.conf mimic3-generic.conf \ @@ -28,6 +29,7 @@ dist_moduleconf_DATA = cicero.conf espeak.conf espeak-ng.conf espeak-ng-mbrola.c dist_moduleconforig_DATA = cicero.conf espeak.conf festival.conf espeak-ng.conf espeak-ng-mbrola.conf flite.conf dtk-generic.conf \ epos-generic.conf \ + edgetts-generic.conf \ espeak-ng-mbrola-generic.conf espeak-mbrola-generic.conf \ llia_phon-generic.conf \ swift-generic.conf mary-generic.conf mimic3-generic.conf \ diff --git a/config/modules/edgetts-generic.conf b/config/modules/edgetts-generic.conf index 9f336dd13..46328af4a 100644 --- a/config/modules/edgetts-generic.conf +++ b/config/modules/edgetts-generic.conf @@ -9,9 +9,10 @@ Debug 0 GenericDefaultCharset "utf-8" GenericExecuteSynth \ -"printf %s \'$DATA\' >$TMPDIR/edge-tts.txt && edge-tts -f $TMPDIR/edge-tts.txt -v \'$VOICE\' --write-media $TMPDIR/edge-tts.mp3 && $PLAY_COMMAND $TMPDIR/edge-tts.mp3" +"printf %s \'$DATA\' | edge-tts --file /dev/stdin -v \'$VOICE\' | mpg123 -q -w - - | $PLAY_COMMAND" GenericCmdDependency "edge-tts" +GenericCmdDependency "mpg123" GenericSoundIconFolder "/usr/share/sounds/sound-icons/" GenericLanguage "en-US" "en-US" "utf-8"