The AtariVox is capable of quite good sounding speech, but getting good speech out of it is a bit of an art.
In this part, I'll take a look at how to get basic voice functionality out of the AtariVox; following the steps in this post will produce output on par or only slightly better than basic text to speech systems, like SAM, Speak'N'Spell, etc.
Just keep in mind that AtariVox can do better than this; I plan to follow-up with another post, with some tips on how to get the AtariVox to sound more natural.
Human speech in any language is made up of atomic sounds called phonemes.
To make the AtariVox speak, instead of sending it english letters, you send it phoneme codes. Because it uses phoneme codes, AtariVox doesn't need to guess if an E is silent, or if a particular C sounds like an S or a K; you're sending it all the information it needs to pronounce the sound.
The phonemes that AtariVox can say can be found on page 15 of the SpeakJet manual (SpeakJet is the Vox chip in AtariVox) along with the code number for each phoneme.
There are a few ways one can determine which phonemes are required to say any particular word...
- The SpeakJet creators, Magnevation, have provided a dictionary of common words and their phoneme composition. Taking the phonemes from the dictionary, you can look up their codes in the SpeakJet manual, and build up a phrase. The dictionary has a very limited number of words, so often you'll be taking phonemes from words with similar sounds. Yes, this is twice as tedious as it sounds.
- Magnevation has also provided a Windows utility, called the Phrase-a-lator, that will take typed in words and sentences and break them into phoneme codes.
Using Phrase-a-lator is definitely less tedious than manual entry, but since Phrase-a-lator uses the same limited dictionary from the manual method, there are many words it doesn't understand.
- batari has created a cross-platform utility called Speak To Me, that can look up your phrase in the SpeakJet dictionary. If a word in the phrase doesn't exist, Speak To Me runs through an algorithm that will attempt a best guess at the phoneme code breakdown.
- I've created a utility called speakalator that operates similar to Phrasealator for Unix platforms. It incorporates batari's code, so it will make a best guess if a word isn't in the dictionary.
...I invite you to try to use all of these methods, and find the technique that works best for you.
Running the phrase "game over" through batari's utility or the Phrase-a-lator provides the following codes, which we'll use for our example code in the next section: 08 b2 9a 8c 08 89 07 a6 97
Making AtariVox Say Our Phrase
Alex Herbert's SpeakJet driver will do most of the heavy lifting for us. Here's a minimal example of how to get the AtariVox to say our "game over" phonemes...
rem ** include the driver asm include "speakjet.inc" end rem ** The AtariVox driver requires 2 consecutive bytes of ram. dim speech_addr=a dim speech_addr2=b rem ** Point the AtariVox at the "game over" data! asm SPEAK data_gameover end mainloop scorecolor=$0f drawscreen goto mainloop rem ** The SPKOUT routine needs to happen each frame. (or every other frame rem ** depending on how many non-voiced codes you use.) The easiest way rem ** get it to update with each frame in bB is to just stick it in vblank... vblank asm SPKOUT temp1 end return rem ** the data ideally starts with 31 to reset the speech frequency, etc. rem ** it must end with a 255 end-marker, or else bad things will happen. data data_gameover 31 $08, $b2, $9a, $8c, $08, $89, $07, $a6, $97 255 end
And that's it!
At the bottom of this post I've included sample code that plays more than one sound... The phoneme codes in the sample are courtesy Alex Herbert, lifted directly from his assemebly language demo.
Points Worth Noting
While using the AtariVox Voice Function is straightforward, there are a few things to keep in mind:
- Stella does not emulate the AtariVox Voice function, but instead can send the codes to a real AtariVox attached to a special low-voltage serial port on your PC. There used to be a USB AtariVox connector, but its not available for sale presently. Another possibility is to connect to the AtariVox with a special TTL level serial port.
- AtariVox speech goes into a buffer, so if you send it a bunch of phrases in a short period of time they'll queue up and it will say all of them. If you want your phrases to interrupt each other, begin your phrases with the command to clear the speech buffer...
data gameover "\0RX" ; stop speaking and clear the buffer $08, $b2, $9a, $8c, $08, $89, $07, $a6, $97 ; game over $ff ; end of data end
Lastly, AtariVox is the creation of Richard Hutchinson, and the drivers were created by Alex Herbert. All of your thanks should go to these guys. I know mine does!
avoxvoice.zip 3.49KB 202 downloads