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.
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.
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.
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.
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 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.