Does anyone have an example of how to change the parameters for TTS?
The documentation:
(class TTS - text to speech — SunFounder Robot HAT documentation)
says:
/# amp: amplitude, volume
/# speed: speaking speed
/# gap: gap
/# pitch: pitch
def espeak_params(self, amp=None, speed=None, gap=None, pitch=None)
But doesn’t show how to implement this as a function.
Can anyone put up an example?
Note the selection of the espeak speech engine.
from robot_hat import TTS
# https://github.com/sunfounder/robot-hat/blob/main/robot_hat/tts.py
tts = TTS({'engine':'espeak'}) # create a TTS object
# "espeak -h"
# Amp should be in 0 to 200
# gap: unit ms
# speed should be in 80 to 260
# pitch should be in 0 to 99
tts.espeak_params(amp=100, speed=200, gap=5, pitch=50)
tts.say('Hello. Nice to meet you.') # speak word
1 Like
Fantastic! thank you. I love the Picar!
Cheers,
1 Like