Espeak sounds slow and broken


28 posts   Page 1 of 2   1, 2
by Vanfanel » Sun Jun 23, 2013 4:11 pm
Hi folks,

I'm trying to play around with espeak, the most popular text-to-speech program for Raspbian, widely used it seems.
I'm on the latest raspbian, updated via sudo apt-get update and sudo apt-get upgrade.
My Rpi is connected to an LCD Tv via HDMI cable.
However, something as simple as:

Code: Select all
espeak -ven "hello pal, this is your raspberyr pi speaking, can you hear it?"


results in missing "hello" (it's missing the first second of audio or so) and a slooooow trembling voice, as if it had some buffer problems.
I took a look at top from another console to see if CPU is the problem, but it's not the case: espeak uses 10-11% CPU.
I also tried connecting the Pi's audio to an external speaker system via the jack connector, and disabling HDMI. I got full audio (no missing first second or so) but still I'm getting a very trembling and broken voice.
I know how espeak should sound: it doesn't have an outstanding quality but it's not this broken as it's heard on the Pi.

Any ideas? Is everybody using espeak with souch a broken voice?
Posts: 385
Joined: Sat Aug 18, 2012 5:58 pm
by Vanfanel » Wed Jun 26, 2013 9:46 pm
Hmm...is espeak working well for you guys?
Posts: 385
Joined: Sat Aug 18, 2012 5:58 pm
by PiGraham » Thu Jun 27, 2013 5:10 am
I just tried espeak and found a similar problem. The start is OK, but a few seconds in the speech slows and becomes Dalek-like - "slow and broken".

I tried overclocking to medium setting to see if that had any effect, but it was no different.

Flite (festival lite) works smoothly.

I have no suggestions.
Posts: 2414
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville
by Vanfanel » Sun Jun 30, 2013 2:13 pm
Exactly, PiGraham: it starts to slowdown and sound broken after a second or so.
Should it be reported somewhere?
Posts: 385
Joined: Sat Aug 18, 2012 5:58 pm
by tykinn » Sun Aug 18, 2013 6:41 pm
I have this problem as well. While not ideal, this works:

Code: Select all
espeak -w out.wav "Greetings and salutations. Here is a test of speech." && aplay out.wav


I also tried festival but there is an unacceptable delay before speech begins, especially when you try one of the better quality voices. CPU usage goes through the roof while waiting for it to play.
Posts: 1
Joined: Sun Aug 18, 2013 6:37 pm
by arista » Sat Aug 24, 2013 9:33 pm
PiGraham wrote:I just tried espeak and found a similar problem. The start is OK, but a few seconds in the speech slows and becomes Dalek-like - "slow and broken".


I've faced the same problem. Latest Raspbian in use (2013-07-26). How to reproduce? Run this command:

Code: Select all
espeak -v fi "8 8 8 8 8"
espeak -v fi "6 6 6 6 6"


After the 2nd "8" (kahdeksan) and the 3rd "6" (kuusi) the speech turns to Dalek-speech (which is somehow cool, I just watched this evening a couple of Doctor Whos with 12-y kid :).

No idea how to fix this (without the out.wav file kludge).
--
Aapo Rista
Posts: 4
Joined: Sat Aug 11, 2012 10:13 am
by karlkiste » Sat Aug 31, 2013 3:29 pm
It must be a problem of connecting to the sound system. This way it works fine:

espeak -f longtext.txt --stdout | aplay

Reads for several minutes now without stuttering.

Greets,
Kiste
Posts: 184
Joined: Tue Jan 22, 2013 8:50 am
Location: berlin, germany
by skidoobond » Sun Sep 01, 2013 4:58 am
Did you take a look at the manual for espeak? There are command line switches that can change the pitch and speech rates. Try something like this:

espeak -s 155 -a 200 "The s and a switches are just some of the espeak options"
User avatar
Posts: 35
Joined: Mon Feb 25, 2013 8:26 pm
by karlkiste » Sun Sep 01, 2013 5:20 am
It is not like "espeak speaks too slow".

It's like it speaks correctly for several seconds, then suddenly between groups of speech samples, a gap appears and the sound "stutters". All speech samples are played, so, due to the gaps, the speech appears stretched or slow. It is not a matter of taste for speech pitch and speed, but a disrupted audio output.
Posts: 184
Joined: Tue Jan 22, 2013 8:50 am
Location: berlin, germany
by karlkiste » Sun Sep 01, 2013 6:48 am
output of

espeak -s 5 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

Samples are shown from the start of the sound output and a few seconds later.
Attachments
espeak-stutter.jpg
some seconds later, stuttering
espeak-stutter.jpg (50.04 KiB) Viewed 11368 times
espeak-ok.jpg
Start of the output
espeak-ok.jpg (54.57 KiB) Viewed 11368 times
Posts: 184
Joined: Tue Jan 22, 2013 8:50 am
Location: berlin, germany
by smanzer » Fri Sep 06, 2013 7:09 pm
Good afternoon.

I have been experimenting with eSpeak for about six months. I have developed a simple routine in python that takes the passed text variable and looks for a space at charactor 25. If the string is > 25 char, it is broken up and the chunks of text are then passed to eSpeak's python code.

While it does not fix the problem, it does work around the issue.

I also had eSpeak randomly crash and not return from the python call. I put a loop on it, and break the loop if this happens.

I will see if I can dig up the code to share. Sure would be nice if someone could figure out what is wrong and fix poor old eSpeak!

Steven
Posts: 3
Joined: Wed Jan 16, 2013 4:26 pm
by rpi_ayu » Mon Sep 30, 2013 8:33 am
you can try something like this its working really fine for me on raspian
you can set amplitude and words per minute and as well as choices for voice-type and different language with different accent .
here i am using the female English voice with us accent
Code: Select all
"espeak -ven-us+f3 --stdout 'Please do registration' -a 300 -s 130 | aplay"
Posts: 30
Joined: Tue Sep 24, 2013 10:55 am
Location: Bhopal
by rpi_ayu » Mon Sep 30, 2013 8:42 am
i am running with infinite loop application in which i am using espeak to produce audio o/p it works really fine for me :D for an hour, but after this its stop working now and still rest of the application do there job correctly but audio is not getting why this is so i really can't understand & also not producing error for troubleshooting (is this really due to infinite loop execution of espeak )
Code: Select all
system("espeak -ven-us+f3 --stdout 'Please do registration' -a 300 -s 130 | aplay")
Posts: 30
Joined: Tue Sep 24, 2013 10:55 am
Location: Bhopal
by shaunmlowry » Tue Oct 01, 2013 1:12 pm
Not sure if this is relevant, but I tried installing espeak on a fresh install of 2013-02-09-wheezy-raspbian.img and it worked beautifully. apt-get update && apt-get upgrade later, and the stuttery speech bug appears. Can anyone think of anything that happened between February and now that could have caused it? I'll try some intermediate images to see if I can narrow down the date range.

Shaun.
Posts: 2
Joined: Tue Oct 01, 2013 1:06 pm
by Vanfanel » Fri Oct 04, 2013 4:44 pm
shaunmlowry wrote:Not sure if this is relevant, but I tried installing espeak on a fresh install of 2013-02-09-wheezy-raspbian.img and it worked beautifully. apt-get update && apt-get upgrade later, and the stuttery speech bug appears. Can anyone think of anything that happened between February and now that could have caused it? I'll try some intermediate images to see if I can narrow down the date range.

Shaun.


This isn't the only audio regression that has been discovered lately. Look here: this one was fixed already:
viewtopic.php?f=78&t=57035

So if this is a regression, Shaun, would you be so kind as to report to popcornmix here?
https://github.com/raspberrypi/firmware ... state=open
Posts: 385
Joined: Sat Aug 18, 2012 5:58 pm
by PlugAndPlay » Sat Oct 05, 2013 8:26 am
Applying the firmware update patch referred to at viewtopic.php?f=78&t=57035 makes a significant difference to espeak: most of the time it now speaks texts without the slow-down issue, though just occasionally it still exhibits the original problem. So many thanks for the heads-up: a good step forwards.
Posts: 5
Joined: Sat Oct 05, 2013 8:18 am
by ravecrocker » Fri Oct 18, 2013 11:56 am
i use espeaking on windows is this the same thing?

also can espeak for raspberry pi play an audio file instead of talk to you for instance if i ask a question a prerecorded message will play?

-Rave
Posts: 4
Joined: Tue Sep 17, 2013 11:50 pm
by karlkiste » Fri Oct 18, 2013 12:51 pm
No, e-speaking seems to be a speech recognition software, not speech synthesis. espeak's only purpose is to "read text aloud".
Posts: 184
Joined: Tue Jan 22, 2013 8:50 am
Location: berlin, germany
by PiGraham » Thu Oct 24, 2013 9:14 pm
I'm still having no luck with espeak.
I just tried again with a fresh Raspbian image : 2013-09-25-wheezy-raspbian.zip
Model A.
No peripherals (camera, SPI etc) enabled.

Ran apt-get update / upgrade and rpi-update.
Rebooted
apt-get install espeak

espeak "This is a long line of test that causes epeak to sound slow and broken"

It sounds a bit fast, but clean, up to "to sound slow..."

I have seen various posts suggesting that espeak works fine on RasPi so I'm puzzled why it doesn't work for me.

Does it work for you? Any ideas how to get it working?
Posts: 2414
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville
by PiGraham » Fri Oct 25, 2013 9:59 am
rpi_ayu wrote:
Code: Select all
system("espeak -ven-us+f3 --stdout 'Please do registration' -a 300 -s 130 | aplay")


I missed this earlier.
That works for me.
Code: Select all
espeak -f textfile.txt --stdout | aplay

Will speak a long text without stuttering.

Thanks.
Posts: 2414
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville
by BlackFighter296 » Sun Dec 29, 2013 1:32 am
I have tested different things (used the eSpeak library in an own program):
- The playback buffer in ms does not have an big effect on the problem
- the --stdout switch for eSpeak uses the stdout to write the wave-header and wave data to the std. out
- aplay than uses it!
- The most voices of eSpeak on my system use around 22050 KHz sample-rate

I come to the solution, that the problem is sample-rate relatet on the Raspberry Pi! Writing to stdout and using aplay only "solves" the problem because I think that aplay does some sample-rate converting.

Anyone anymore ideas?
Posts: 2
Joined: Sun Dec 29, 2013 1:29 am
by BlackFighter296 » Sun Dec 29, 2013 11:12 am
I've opened a bug report on sourceforge eSpeak repo for further investigation of the problem:

https://sourceforge.net/p/espeak/bugs/110/
Posts: 2
Joined: Sun Dec 29, 2013 1:29 am
by snowtech » Sat Mar 22, 2014 4:27 pm
It looks like the problem still there ...
Im using this command to read out the txt file :

Code: Select all
espeak -f temperature.txt --stdout | aplay

It works no problem ... I think for now, I can get away with it ...

Thanks everyone
Posts: 9
Joined: Tue Mar 18, 2014 11:08 am
by pickle_pie » Mon Mar 31, 2014 2:47 pm
I was having the same problems with espeak. I'm using a Daffodil USB Sound Adapter http://www.amazon.com/Daffodil-US01-Channel-Microphone-Speaker/dp/B002FI7GWK.

After making the following change to my .asoundrc file it now works fine:

Code: Select all
pcm.!default {
   type hw
   card 0
}
ctl.!default {
   type hw
   card 0
}


pcm.pulse {
   type pulse
   card 0
}

ctl.pulse {
   type pulse
   card 0
}

pcm.!default {
   type pulse
   card 0
}

ctl.!default {
   type pulse
   card 0
}

By the way, MPD also works well on the same PI.

This is where I got the information about .asoundrc file: http://www.cs.vassar.edu/~priestdo/emacspeak/2010/msg00068.html
Posts: 24
Joined: Sun Dec 29, 2013 4:35 am
by fudge » Mon Aug 04, 2014 8:48 am
Hi, I have a B+ running raspbian kern 3.12.25+ espeak 1.46. So I am a blind user and have loaded the speakup_soft modules and installed espeakup, it speaks from boot but the sound becomes what I would explain as blurry. Also if using the numpad to read/review the console fast usage is incurred it all goes to the dog house with some kind of kernel loops. So I wonder if the same problem is as described in this thread. Would trying Espeak 1.48 solve this for anyone?
Posts: 1
Joined: Mon Aug 04, 2014 8:38 am