rany2 / edge-tts

Use Microsoft Edge's online text-to-speech service from Python WITHOUT needing Microsoft Edge or Windows or an API key
https://pypi.org/project/edge-tts/
GNU General Public License v3.0
5.38k stars 549 forks source link

Make edge-playback more instantaneous for large text #103

Open rany2 opened 1 year ago

rany2 commented 1 year ago

This was done in the past however when subtitles were added this stopped being possible as easily.

Split text into chunks for subtitles to work properly for edge-playback and to provide instantaneous playback.

rany2 commented 1 year ago

Why? Because I want to integrate it with https://github.com/wustho/epy but I don't want to wait for ages for the playback.

KonerDev commented 1 year ago

Yes absolutely. Couldn't you have it read everything live so that you don't need any temporary files at all?

rany2 commented 1 year ago

I've done that before but had to stop doing that so the subtitle generation works.

KonerDev commented 1 year ago

Can you maybe make it optional?

CheerfulPianissimo commented 10 months ago

FWIW edge-tts -t "text here" | mpv - starts playing audio instantaneously independent of text size.

rany2 commented 10 months ago

@CheerfulPianissimo that's how the edge-playback command used to work before adding subtitles support :)

nazdridoy commented 4 months ago

Why? Because I want to integrate it with https://github.com/wustho/epy but I don't want to wait for ages for the playback.

any progress? i get "TimeoutError" and partial audio (1-9 min at random)

rany2 commented 4 months ago

Why? Because I want to integrate it with https://github.com/wustho/epy but I don't want to wait for ages for the playback.

any progress? i get "TimeoutError" and partial audio (1-9 min at random)

If you're on Linux/Mac, you could do edge-tts --text "$@" 2>/dev/null | mpv - (or Windows equivalent); it will do it immediately. Unfortunately, the partial audio is this issue: https://github.com/rany2/edge-tts/issues/190