We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd9fe07 commit 3e0cb22Copy full SHA for 3e0cb22
ev3dev/core.py
@@ -2814,9 +2814,10 @@ def play(wav_file):
2814
return Popen('/usr/bin/aplay -q "%s"' % wav_file, stdout=n, shell=True)
2815
2816
@staticmethod
2817
- def speak(text):
+ def speak(text, espeak_opts='-a 200 -s 130'):
2818
"""
2819
Speak the given text aloud.
2820
2821
with open(os.devnull, 'w') as n:
2822
- return Popen('/usr/bin/espeak -a 200 --stdout "%s" | /usr/bin/aplay -q' % text, stdout=n, shell=True)
+ cmd_line = '/usr/bin/espeak --stdout {0} "{1}" | /usr/bin/aplay -q'.format(espeak_opts, text)
2823
+ return Popen(cmd_line, stdout=n, shell=True)
0 commit comments