From 683877910d9194253dc6f46fe0021f038e92578b Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Fri, 01 Oct 2010 18:42:45 +0000 Subject: Use the same default rate in espeak command mode like in gst mode #2182 --- 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 -- cgit v0.9.1