Notifications
Clear all

eSpeak on a Raspberry Pi 4

116 Posts
9 Users
30 Reactions
22.7 K Views
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
Topic starter  

I finally finished the introductory video on how to install eSpeak on a Raspberry Pi 4.

Allow me to mention some disclaimers before you torture yourself watching this video

First off, if all you want to do is play with eSpeak out of the box, all you need to do is go to the command prompt in Raspbian and type in the following command:

sudo apt-get install espeak

That simple command will install espeak.

Next you can simply type in:

espeak "hello world"

And if you have a sound system on your Raspberry Pi you should hear espeak say "hello world".

It's that easy to use eSpeak. 😊 

If you want more options just type in the command:

espeak -h

and you'll get a list of optional parameters you can use.

~~~~~~~~~~~~~~~~~~~

So why a near one-hour video on how to install eSpeak???

Well, the installation described in the video includes far more than the simple eSpeak package.  It also includes voice files that can be modified, dictionary source files that can be modified, phoneme files that can be modified, mbrola.exe and MBROLA voices, and an additional program called espeakedit.   It's the whole shebang for anyone who might be interested in exploring all the capabilities and options available in eSpeak.

So if you just want to make your computer talk, the above method might be all you need.  But if you have an interest in exploring all the possibilities of eSpeak you may want to suffer through this video and install the whole shebang.   It doesn't take up a lot of SD card space and I actually installed this, and even made this entire video, using a 16GB Raspbian system card.

In any case, here's the video.  Let me know what you think of it.

It wasn't my intent to make this into an hour-long video.  That's just how things worked out.  And this video is just an explanation of eSpeak along with the installation of all the aforementioned accessories.

I'm currently working on producing a second video in the series where I write a Python program to run eSpeak from Python.  I have a funny feeling that too will end up being an hour long.   It's hard to keep these videos short and still cover everything I would like to cover.

In any case, if I succeed in finishing the Python video, I'm hoping to make yet another one just devoted to modified eSpeak and MBROLA voices.

If I live beyond that I would like to make one more on how to modify and compile dictionaries.   What will be a total of 4 videos.   

I was also toying with the idea of making a 5th video on espeakedit.  But I'm not sure I'll go that far.  Espeakedit is really for people who want to get deeply involved in adjusting phonemes and creating their own specific voice dialects, or languages.  This is probably beyond the scope of what most people would be interested in, including me.   So not sure exactly how far I'll take this.

In any case, let me know what you thought of this one, and give it a thumbs up or thumbs down to let me know your honest assessment.

DroneBot Workshop Robotics Engineer
James


   
triform, frogandtoad, codecage and 1 people reacted
Quote
Spyder
(@spyder)
Member
Joined: 5 years ago
Posts: 846
 

Now I need another Pi4


   
ReplyQuote
Spyder
(@spyder)
Member
Joined: 5 years ago
Posts: 846
 

Okay, wait, maybe I could install this on that laptop I built

How does it affect the regular operation of the computer ?

Could I install this whole package and have it still operate as a standard pi, and nobody would notice that something extra was added ? Or will I have to sacrifice the GUI ?


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1046
 

It wasn't long enough!  It was just getting really interesting.  But now I have some new play toys to entertain me until the next video! 🤗 

Great work James!!

Ooh, added to the AI on the Jetson Nano it could speak the name of the face it has recognized.

Can I assume it installs on the Jetson in the same manner as the RasPi?

SteveG


   
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@robo-pi

Nice video and well done!
You did a great job of introducing eSpeak to people like me!

 


   
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@robo-pi

By the way... I forgot to mention earlier that it's not really a problem to be root for short periods of time... your frustration seems to stem that it took you a while to create and copy files to a root locations, but you only really have to run one command to do the whole lot in one go, for example, create them as normal, then:

sudo mv -v ~/U* /
OR...
sudo mv -v ~/U1 ~/U2 ~/U3 /


   
ReplyQuote
triform
(@triform)
Member
Joined: 5 years ago
Posts: 324
 

@robo-pi great job!

 

I do wish I could talk clear and concise like Bill and yourself!  My mouth and brain are not connected well 🙁

Again, good job.

 

Scott

  


   
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@triform

Doing just fine! 😉


   
ReplyQuote
triform
(@triform)
Member
Joined: 5 years ago
Posts: 324
 

@frogandtoad

Typing I can, talking no.  Autism... 


   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
Topic starter  
Posted by: @spyder

Okay, wait, maybe I could install this on that laptop I built

As far as I know it should install on any Linux system pretty much in the same way.  It shouldn't be dependent on hardware.  If you're installing it on Windows it may require a different installation process.  I haven't tried installing it on Windows as I use Microsoft Speech Platform over there.  MSP has both TTS and SRE capabilities.   If you want SRE capabailities you'll need to also install Pocket Sphinx which I'm hoping to do after I'm done with the eSpeak Series.

Posted by: @spyder

How does it affect the regular operation of the computer ?

As far as I know it has no effect at all.  This may be different for the SRE Pocket Sphinx because the SRE needs to listen all the time.  But eSpeak being a TTS only needs to speak when it's told to speak by your program.  So when it isn't speaking it's like it isn't even there, other than the small space it takes up on the SD card to just sit there.

Posted by: @spyder

Could I install this whole package and have it still operate as a standard pi, and nobody would notice that something extra was added ? Or will I have to sacrifice the GUI ?

If you're not using it to speak there's no reason anyone would know it's even installed on the computer.  It really  has nothing to do with the GUI save for the single entry of the espeakedit in Sound & Video.  But you don't need to have espeakedit to use espeak.  espeakedit will only be used if you want to customize the way it says specific words and add those to the dictionary.

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
Topic starter  
Posted by: @codecage

It wasn't long enough!  It was just getting really interesting.

I was going to wait until I get the whole series down and post them all together.  But I'm not sure when that will be completed, so I thought I'd toss this one out now.  The next one will be on how to run eSpeak from Python.

Posted by: @codecage

Ooh, added to the AI on the Jetson Nano it could speak the name of the face it has recognized.

Absolutely!  In fact, I'm learning about espeak right now so I can incorporate it into all my other AI projects.  By the way I just ordered two more Raspberry Pi 4s.  They came today.  So I have a total of four of them now.  I get them as a kit from Vilros.com.  They are the 4GB memory model and come with heat sinks, fan, case, and even a 32BG SD card, and a powersupply with an in-line switch for $99.   So it a nice little package pretty much ready to go only needing a monitor, keyboard, and mouse.  Or they can also be run headless, which is how I'll run them when they are in robots. 

Posted by: @codecage

Can I assume it installs on the Jetson in the same manner as the RasPi?

It should be pretty much identical.  There may be slight differences in how some of the directories are named where the systems are stored when installed, but other than that it's pretty much the same installation.

I should mention here also that what I've shown in the video is how I ended up doing it.  There are most likely better ways to install all these packages.   All I can say is that the way I've shown works.  So I just went with what works.  I'm no Linux guru.  I just fumble my way around in the dark. 😊 

 

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
Topic starter  
Posted by: @frogandtoad

@robo-pi

By the way... I forgot to mention earlier that it's not really a problem to be root for short periods of time... your frustration seems to stem that it took you a while to create and copy files to a root locations, but you only really have to run one command to do the whole lot in one go, for example, create them as normal, then:

sudo mv -v ~/U* /
OR...
sudo mv -v ~/U1 ~/U2 ~/U3 /

Thanks for the tips.  I should spend some time learning all the little quirks of Linux commands, but I confess to being lazy and using the GUI desktop whenever possible.   So I don't typically need to spend a lot of time using the terminal. 

In fact, as I said in the video, I probably could have installed eSpeak and eSpeak Edit from those original files I downloaded by "making" them from those downloads.  I actually did try to do that but I kept getting errors that they were missing files or couldn't gain access to shared files, etc.   So I just gave up on trying to do that way and restored to the way I did it in the video.   It's probably not the best way to install eSpeak, but it seems to be working so far.

By the way, I can't seem to find any other good videos on installing espeak in depth.  What I typically find is what I suggested to do at the beginning of the thread.  Just sudo apt-get install espeak.   That works if all you want is the basic package to use "as-is".  But if you want to move on to working with dictionaries you don't get all the files to enable you to do that.  This is why I also had to download those zip files from the eSpeak sourceforge page. Dictsource is necessary if you want to work with modifying dictionaries.  And Phsource is required if you want to work with modifying phonemes using eSpeak Edit.

Modifying dictionaries and phonemes is probably beyond where most people want to go.  But for my AI projects the ability to modify dictionaries is going to be paramount.

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
Topic starter  
Posted by: @triform

@frogandtoad

Typing I can, talking no.  Autism... 

You can use a TTS conversion to convert your text to speech for your YouTube Videos.   And you don't even need eSpeak to do this.  Just go to www.fromtexttospeach.com and you can convert your text to speak online.

Here's some text I had converted to speech:

This is my text being converted for use in a YouTube video. I just typed these words into a text file and pasted them into the web site at www dot from text to speech dot com. There are several voices to choose from. You can then use these voice files in your video. This voice was created using George as the speaker.

and here's the resulting audio mp3 file:

http://www.fromtexttospeech.com/output/0220700001588978772/55348424.mp3

 

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
Spyder
(@spyder)
Member
Joined: 5 years ago
Posts: 846
 

@robo-pi

The laptop I was referring to is that Jules Verne project I built months ago and has been sitting on a shelf looking like nothing more than a collector's item. So it's a Pi 4, not windows

I ordered a Pi 4 last night, but, with the CV delays, who knows how long it'll take to get here. So that's why I wanted to know how it would affect the standard operation of the computer... I want that laptop to be just a laptop that looks freaky, and would rather not have it turned into something for a specific use-case. As long as nobody can tell the speaky thing is on there, I have no problem experimenting with it until the new one arrives (the Pi itself is WAY down at the bottom, under all the wires and keyboard and mousey doohicky that I didn't actually put enough effort into running properly to make neat enough to show off at a museum, so, getting to the SD card would be... not my favorite thing to do. It's quite the rat's nest in there which is why the box is so big... to hide all those wires that I was too lazy to neaten up)

So I'm going to plug it in (down in the lab cuz my office space is kind of consumed by robot parts at the moment) and work it from there, although, now that I think about it, I seem to have left out a provision for speakers on the thing, which means that I now have another project to tend to before I can start on that one

Dominoes... gotta love'm


   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
Topic starter  
Posted by: @spyder

I seem to have left out a provision for speakers on the thing, which means that I now have another project to tend to before I can start on that one

Yep, you'll need an audio output to use eSpeak.   I see no reason why eSpeak would get in the way of anything else, or be noticeable to anyone if it wasn't being actively used.   When I'm done sorting through both eSpeak and Pocket Sphinx I'm going to set up SD system cards that just have those packages installed as part of the basic system.  Even Pocket Sphinx will have no effect on the rest of the system until you have it actively listening.   So just having it sit there for possible use won't affect the rest of the system.  In fact, I'm not sure exactly what effect Pocket Sphinx will have when it is actively listening.  But obviously if it's listening it must be processing some sort of listening loop.  eSpeak, on the other hand, doesn't need to listen so it has no need to be running outside of the times you actually tell it to say something.

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
Page 1 / 8