Drop words_in_cue code for SubMaker and switch to SRT (#323)

WebVTT isn't a very common format in the first place
and attempting to make WordBoundary play nice with
input text is very hard.

Instead we now just display the word that the TTS
is saying at a given time. In the future, we could
try to enable SentenceBoundary but there is a risk
that it will be banned by Microsoft as it is not used
by Microsoft Edge itself.

Closes: https://github.com/rany2/edge-tts/issues/118
Closes: https://github.com/rany2/edge-tts/issues/171
Closes: https://github.com/rany2/edge-tts/issues/229
Closes: https://github.com/rany2/edge-tts/issues/234

Signed-off-by: rany <rany2@riseup.net>
This commit is contained in:
Rany
2024-11-22 20:58:47 +02:00
committed by GitHub
parent 5a2674cd03
commit 4f5d79ed57
6 changed files with 38 additions and 123 deletions

View File

@@ -18,7 +18,7 @@ If you only want to use the `edge-tts` and `edge-playback` commands, it would be
If you want to use the `edge-tts` command, you can simply run it with the following command:
$ edge-tts --text "Hello, world!" --write-media hello.mp3 --write-subtitles hello.vtt
$ edge-tts --text "Hello, world!" --write-media hello.mp3 --write-subtitles hello.srt
If you wish to play it back immediately with subtitles, you could use the `edge-playback` command:
@@ -48,7 +48,7 @@ You can change the voice used by the text-to-speech service by using the `--voic
ar-EG-SalmaNeural Female General Friendly, Positive
...
$ edge-tts --voice ar-EG-SalmaNeural --text "مرحبا كيف حالك؟" --write-media hello_in_arabic.mp3 --write-subtitles hello_in_arabic.vtt
$ edge-tts --voice ar-EG-SalmaNeural --text "مرحبا كيف حالك؟" --write-media hello_in_arabic.mp3 --write-subtitles hello_in_arabic.srt
### Custom SSML
@@ -58,9 +58,9 @@ Support for custom SSML was removed because Microsoft prevents the use of any SS
You can change the rate, volume and pitch of the generated speech by using the `--rate`, `--volume` and `--pitch` options. When using a negative value, you will need to use `--[option]=-50%` instead of `--[option] -50%` to avoid the option being interpreted as a command line option.
$ edge-tts --rate=-50% --text "Hello, world!" --write-media hello_with_rate_lowered.mp3 --write-subtitles hello_with_rate_lowered.vtt
$ edge-tts --volume=-50% --text "Hello, world!" --write-media hello_with_volume_lowered.mp3 --write-subtitles hello_with_volume_lowered.vtt
$ edge-tts --pitch=-50Hz --text "Hello, world!" --write-media hello_with_pitch_lowered.mp3 --write-subtitles hello_with_pitch_lowered.vtt
$ edge-tts --rate=-50% --text "Hello, world!" --write-media hello_with_rate_lowered.mp3 --write-subtitles hello_with_rate_lowered.srt
$ edge-tts --volume=-50% --text "Hello, world!" --write-media hello_with_volume_lowered.mp3 --write-subtitles hello_with_volume_lowered.srt
$ edge-tts --pitch=-50Hz --text "Hello, world!" --write-media hello_with_pitch_lowered.mp3 --write-subtitles hello_with_pitch_lowered.srt
## Python module