Sample Colab Notebook for faster than real-time speech synthesis on a CPU

@florian_4_sepia beat me to it! :slightly_smiling_face:

As I’d tested purely the espeak and espeak-ng parts alone (ie not as part of TTS), maybe it’s still worth me posting this.

My simple test script is attached. It runs espeak (or espeak-ng) with test phrases, repeating it within timeit 1,000 times for each, so we can simply take the times printed (which are in seconds) and treat them as milliseconds for a single run.

It’s just showing the time to output the IPA for the input samples (first two match @florian_4_sepia 's sentences and then there’s a longer quote of just over 600 characters)

As you’ll see there’s very little in it, but espeak is marginally faster than espeak-ng.

The timings for both are so low, it does look like it won’t make a meaningful difference cutting them.

With espeak

Installed simply with sudo apt install espeak

pi@rpi4B3:~/Projects/espeak_tests $ python3 time_espeak_calls.py
Running timing test
“Hello this i” (full length: 20)
8.488519589000134
Running timing test
"Bill got in " (full length: 126)
13.674001921000126
Running timing test
“It was the b” (full length: 612)
39.1383117169998

With espeak-ng

Installed simply with sudo apt install espeak-ng

Install was done after running sudo apt remove espeak and rebooting to ensure there’s no interference between the two.

pi@rpi4B3:~/Projects/espeak_tests $ python3 time_espeak-ng_calls.py
Running timing test
“Hello this i” (full length: 20)
10.240827402
Running timing test
"Bill got in " (full length: 126)
15.530353007999999
Running timing test
“It was the b” (full length: 612)
42.789440690999996

Script is attached. Please note that unlike on Arch, installing espeak-ng on the Pi doesn’t seem to add a symlink to make the espeak command point to espeak-ng so you simply need to update the command within the script (leaving the parameters as they are).

time_espeak_calls.zip (854 Bytes)

1 Like