Skip to content

Add Edge TTS generic output module - #1110

Open
Jyatin wants to merge 2 commits into
brailcom:masterfrom
Jyatin:feat/edge-tts-support
Open

Add Edge TTS generic output module#1110
Jyatin wants to merge 2 commits into
brailcom:masterfrom
Jyatin:feat/edge-tts-support

Conversation

@Jyatin

@Jyatin Jyatin commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds an initial generic output module configuration for using Microsoft Edge TTS with Speech Dispatcher.

Changes

  • Add config/modules/edgetts-generic.conf
    • Adds support for en-US, hi-IN, bn-IN, and gu-IN
    • Adds several Edge TTS neural voices
    • Configures the generic module to invoke an Edge TTS wrapper
  • Change the generic module shell from /bin/sh to /bin/bash
    • Required because the generic module currently executes commands using set -o pipefail
    • /bin/sh resolves to dash on the tested WSL environment, which does not support pipefail

Testing

Tested locally on WSL2 with Speech Dispatcher and Edge TTS.

Verified that:

  • Speech Dispatcher invokes the generic module.
  • The Edge TTS wrapper is invoked successfully.
  • Edge TTS generates an MP3 file.
  • Audio playback works successfully.

@sthibaul sthibaul left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, just a few fixes are needed.

Comment thread config/modules/edgetts-generic.conf Outdated
Comment thread config/modules/edgetts-generic.conf Outdated
Comment thread config/modules/edgetts-generic.conf Outdated
@Jyatin

Jyatin commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I’ve addressed the requested changes:

Added copyright information to the configuration.
Replaced the unavailable speechd-edge-wrapper with the edge-tts command directly.
Added GenericCmdDependency "edge-tts" so the module is disabled when the command is unavailable.
Verified the configuration locally and confirmed that Edge TTS successfully generates audio.

Please let me know if any further changes are needed.

@Jyatin

Jyatin commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

he Edge TTS voices are provided by the online Edge TTS service and do not depend on local voice files, so VoiceFileDependency is not applicable here. GenericCmdDependency "edge-tts" ensures that the module is disabled when the edge-tts command is unavailable.

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"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, when the user configured to use the alsa audio device, $PLAY_COMMAND is aplay, which does not support the mp3 formation. Can edge-tts support wave format? That'll also avoid having to compress the audio, only for the audio player to re-decompress it.

Also, ideally you would avoid using temporary files, by passing the data through pipes | . If edge-tts does not have a special notation for that (it's often - to be given as file name), you can trick it by passing it /dev/stdin and /dev/stdout.

@sthibaul sthibaul left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also need to add the file in config/modules/Makefile.am to dist_moduleconf_DATA and dist_moduleconforig_DATA

@sthibaul

Copy link
Copy Markdown
Collaborator

Also, please mention the support in README.md ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants