edge-tts suddenly stopped working on Ubuntu (NoAudioReceived error), but works fine on Windows

3 weeks ago 29

Hey everyone,

I’ve been using the edge-tts Python library for text-to-speech for a while, and it has always worked fine. However, it has recently stopped working on Ubuntu machines — while it still works perfectly on Windows, using the same code, voices, and parameters.

Here’s the traceback I’m getting on Ubuntu:

NoAudioReceived Traceback (most recent call last) /tmp/ipython-input-1654461638.py in <cell line: 0>() 13 14 if __name__ == "__main__": ---> 15 main() 10 frames /usr/local/lib/python3.12/dist-packages/edge_tts/communicate.py in __stream(self) 539 540 if not audio_was_received: --> 541 raise NoAudioReceived( 542 "No audio was received. Please verify that your parameters are correct." 543 ) NoAudioReceived: No audio was received. Please verify that your parameters are correct.

All parameters are valid — I’ve confirmed the voice model exists and is available.

I’ve tried:

  • Reinstalling edge-tts
  • Running in a clean virtual environment
  • Using different Python versions (3.10–3.12)
  • Switching between voices and output formats

Still the same issue.

Has anyone else experienced this recently on Ubuntu or Linux?
Could this be related to a backend change from Microsoft’s side or some SSL/websocket compatibility issue on Linux?

Any ideas or workarounds would be super appreciated 🙏

code example to test:

import edge_tts TEXT = "Hello World!" VOICE = "en-GB-SoniaNeural" OUTPUT_FILE = "test.mp3" def main() -> None: """Main function""" communicate = edge_tts.Communicate(TEXT, VOICE) communicate.save_sync(OUTPUT_FILE) if __name__ == "__main__": main()
submitted by /u/Majestic_Side_8488 to r/Python
[link] [comments]
Read Entire Article