Learning Spin: Text-to-Speech

screen.jpg

Let's take a look at Text-to-Speech & show you an example of how objects can be used.  My other tutorials (including my written objects guide) are here.

The Code

You can also download it here.

Building on previous tutorials, there are a few new concepts;

Pipe (|)
When you declare a method (), you can use a pipe (the key above the backslash on your keyboard) and declare local variables.  Here, I've declared just one, 'i'.  You can declare multiple with a comma between each; PUB start | i,x,z.  Local variables are only available within the method (other methods can't access them), and are re-initialized each time the method is called.  They're often used for controlling incrementing loops and other throwaway type activities.

Symbol Address (@)
The @ sign return the address the variable is stored instead of the value.

https://vimeo.com/16321084

Not bad

I have been playing with this one sense you zapped it to me and yeah, I like it. I do have to say that Yoo riilee need too spell things foneticklee. All in all not bad --and I am surprised how small it is on the chip.

Lets mayk rowbots

Phil’s phoneme library isn’t complete, the spelling works pretty well, though (just change the method to t.spell). I should have typed ‘hello’ as ‘hellow’. 

I think using wav samples off an SD card is better for actual use, but using a keyboard was fun. 

It all about real time…

Thus my delema… As you know, Walter’s voice is done by a friend in London. The voice is mp3 and crystal clear but I must know in advance everything I want him to say. At best, he can say numbers on-the-fly but of course, one at a time. With any kind of speech like you are showing here, there is always going to be a trade between quality and vocabulary. I will say this though, as a point-of-reference, the ability to simply understand the “propeller voice” is for sure, a plus. I would put it against the crap coming out of a speak-jet any day.

I didn’t know about speakjet

I checked it out - the sound quality isn’t that bad, although the price hurts ($25!).  One thing I do like about Phil’s phoneme library is it’s all open source, so anyone can improve on it. 

For my talking alarm clock, I just concatenated wav’s ‘40.wav + 5.wav = forty five’.  Propeller TTS requires some pre-prep, too.  Unless you just want it to spell stuff. 

Are you using the speach

Are you using the speach demo Object that I sent you or a different one?

I started with yours

but Phil put an updated copy on the Parallax forums a few days ago.  I think they’re pretty much the same, though.

The search feature on the

The search feature on the OBEX is less than desired. What name did Phil use so I can find it?

Not in the obex

Because I think it’s GPL instead of MIT.  But here’s the forum post - http://forums.parallax.com/showthread.php?t=126586