Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/espeak_cmd.py
diff options
context:
space:
mode:
Diffstat (limited to 'espeak_cmd.py')
-rw-r--r--espeak_cmd.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/espeak_cmd.py b/espeak_cmd.py
index 8f7bb9f..48a27a0 100644
--- a/espeak_cmd.py
+++ b/espeak_cmd.py
@@ -24,15 +24,13 @@ import espeak
PITCH_MAX = 99
RATE_MAX = 99
-PITCH_DEFAULT = PITCH_MAX/2
-RATE_DEFAULT = RATE_MAX/3
class AudioGrabCmd(espeak.BaseAudioGrab):
def speak(self, status, text):
self.make_pipeline('filesrc name=file-source')
- # espeak uses 80 to 370
- rate = 80 + (370-80) * int(status.rate) / 100
+ # 175 is default value, min is 80
+ rate = 80 + int(((175 - 80) * 2) * status.rate / RATE_MAX)
wavpath = "/tmp/speak.wav"
subprocess.call(["espeak", "-w", wavpath, "-p", str(status.pitch),