Skip to content

7.4.1

Choose a tag to compare

@rany2 rany2 released this 29 Nov 13:35
· 8 commits to master since this release
Immutable release. Only release title and notes can be modified.

Bug fixes

  • Early WebSocket closes are now detected and retried. Before this fix, if the service dropped the connection before finishing a request, edge-tts either raised a misleading NoAudioReceived ("Please verify that your parameters are correct") or, if some audio had already arrived, returned truncated audio without raising an error. A close before the request finishes is now always treated as a failure:

    Situation Exception Retried
    Closed before any audio ConnectionClosedBeforeAudio (new, subclass of NoAudioReceived) Yes, with exponential backoff
    Closed after some audio IncompleteAudio (new) No, because the audio was already yielded
    Finished normally without audio (for example, text the voice can't pronounce) NoAudioReceived No

    By @rany2 in #529. Fixes #473 (reported by @cuongnl) and #512 (reported by @TiepHoangDev).

New features

  • Communicate takes two new arguments: max_retries (default 2) and retry_delay (default 1.0 seconds, doubled after each retry). Retries happen per text chunk and only when nothing from that chunk has been yielded yet, so output is never duplicated.
  • NoAudioReceived and IncompleteAudio now have close_code and received attributes (the message types received before the failure). Their messages describe what actually went wrong and link to the troubleshooting guide.

⚠️ Behaviour change

  • Code that used to get truncated audio without an error now gets IncompleteAudio. Existing except NoAudioReceived handlers still catch ConnectionClosedBeforeAudio.

Documentation

  • TROUBLESHOOTING.md is now organised around the three cases above.
  • LICENSE now refers to srt.py instead of the removed srt_composer.py.
  • The PyPI package description has been improved.

Tooling

  • PyPI releases now include provenance attestations.

Full Changelog: 7.4.0...7.4.1