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
4.24k stars 447 forks source link

Subtitles split: leave the whole word, without the hyphen '-' #118

Open Quit4944 opened 11 months ago

Quit4944 commented 11 months ago

Hi. thanks for the nice work. I appreciate. When I set words_in_cue (example to 40), the program splits the sentence into various parts, sometimes it wraps without breaking the word (and that's fine with me), but sometimes it breaks the word by putting the hyphen '-', and this makes the reading and fluency of the text difficult. I would like to split the sentence using the last blank ' ' found before the 80 characters, without a hyphen; If the line becomes less than 80 characters it doesn't matter to me. Something like this: https://stackoverflow.com/a/25854068 (obviously in python, not java). Is this something that can be implemented? or does it already exist?