Hardware Reference
In-Depth Information
More Ideas
here are many things you can do with your own toy. Here are some suggestions:
❍
Try changing the arguments passed to espeak. (Don't forget that
-h
will give you a list
of options.) For example, you could try
•
Diferent languages
•
Diferent voices, both male and female
•
Changing pitch
•
Changing speed
Here's an example of how you could change
espeak.py
:
import subprocess
DEFAULT_PITCH = 50 # 0-99
DEFAULT_SPEED = 160 # words per min
def say(words, pitch=None, speed=None):
if not pitch:
pitch = DEFAULT_PITCH
if not speed:
speed = DEFAULT_SPEED
devnull = open("/dev/null", "w")
try:
subprocess.call([
"espeak",
"-v", "en-rp", # english received pronunciation
"-p", str(pitch),
"-s", str(speed),
words],
stderr=devnull)
❍
You could change the speech parameters depending on who is talking or the content of
the tweet.