Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--espeak_cmd.py6
-rw-r--r--espeak_gst.py2
-rw-r--r--face.py5
3 files changed, 5 insertions, 8 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),
diff --git a/espeak_gst.py b/espeak_gst.py
index 27f20ec..3b1d326 100644
--- a/espeak_gst.py
+++ b/espeak_gst.py
@@ -22,8 +22,6 @@ import espeak
PITCH_MAX = 200
RATE_MAX = 200
-PITCH_DEFAULT = PITCH_MAX/2
-RATE_DEFAULT = RATE_MAX/2
class AudioGrabGst(espeak.BaseAudioGrab):
def speak(self, status, text):
diff --git a/face.py b/face.py
index a3b5d7b..fb991bb 100644
--- a/face.py
+++ b/face.py
@@ -44,8 +44,9 @@ FACE_PAD = 2
class Status:
def __init__(self):
self.voice = voice.defaultVoice()
- self.pitch = espeak.PITCH_DEFAULT
- self.rate = espeak.RATE_DEFAULT
+ self.pitch = espeak.PITCH_MAX / 2
+ self.rate = espeak.RATE_MAX / 2
+
self.eyes = [eye.Eye] * 2
self.mouth = mouth.Mouth