Repository navigation
7.4.1
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 ofNoAudioReceived)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) NoAudioReceivedNo By @rany2 in #529. Fixes #473 (reported by @cuongnl) and #512 (reported by @TiepHoangDev).
New features
Communicatetakes two new arguments:max_retries(default2) andretry_delay(default1.0seconds, 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.NoAudioReceivedandIncompleteAudionow haveclose_codeandreceivedattributes (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. Existingexcept NoAudioReceivedhandlers still catchConnectionClosedBeforeAudio.
Documentation
- TROUBLESHOOTING.md is now organised around the three cases above.
- LICENSE now refers to
srt.pyinstead of the removedsrt_composer.py. - The PyPI package description has been improved.
Tooling
- PyPI releases now include provenance attestations.
Full Changelog: 7.4.0...7.4.1