Retro computer speech synthesis with an android phone
As an owner of a VIC-20 and a few Scott Adams adventure games, I wondered how the function of speech synthesis (as mentioned in the manual of these games) would sound like. Unfortunately, I do not own a Votrax type 'n' talk and I'm sure that not many people do. This device was a text-to-speech device. Where normal speech synthesizer chips would require a set of phonemes send over a parallel port, the Votrax type 'n talk could convert text directly into speech while using only a single serial line. This made the device very easy to connect to different types of computers... but also very expensive. But the biggest advantage would be that adding speech to an application, using the Votrax type 'n talk, has a very low impact on the program using it. Because the text printed to screen could also be send to the serial port (without any conversion) and directly spoken by the device. A great device for it's time, but out of reach for most of us. So I found a way to make this possible using modern components and a smartphone.
Note: this project has been superseded by a new project named SSSSAM, which will be presented on my website soon.
Why this project?
Using Votrax type 'n talk (or the adapter+smartphone on this page) in combination with the Scott Adams adventure games, you could add a new dimension to adventure games, simply by the addition of speech. Well to be honest, I'm no gamer and adventure games require a lot of patience and imagination. But when I saw a new device for the VIC-20, the VIC-voder, I was a little surprised. The VIC-voder consists of a raspberry pi (a mini computer with lot's of memory and storage room) and along with an amplifier it fit's snugly into a small project box. You must connect it to the userport of a VIC-20 or other CBM computer. At first, knowing the specs of the raspberry pi, I considered this as a huge overkill sollution to a relatively simple problem. But then I realized that "overkill" is not the point. This approach is great because the raspberry pi is pretty cheap and will perform great for this job! But for some reason I wasn't tempted in building it myself.
Then many months later, I bought a smartphone, the cheapest reasonable powered android I could find, costing me only 49 Euro at the local electronics store. It has an extra discount because the model was a demonstration model. Good enough for me because I did not want to spend much money on a device I wasn't going to use a lot (let's say I'm not a social guy that wants to communicate a lot). The reason I bought it was because I felt I was getting the feeling of getting old, simply because I did not understood how smartphones and tablets should be used. So to keep up with progress, I bought one. And perhaps I could write my own apps for it, could be fun. And then it hit me... the phone was pretty powerful and certainly could produce speech (with the right app installed). Hmm... if I could connect the VIC-20 to my smartphone... Well, I bought a Bluetooth to serial device, for a few euros and started to experiment. And because of the Christmas vacation coming up, I decided to make this my little vacation project. The first module I bought was a Bluetooth low energy device... but... my phone did not support this type of Bluetooth. Oops... a lesson learned the hard way. So I bought a classic Bluetooth to serial device the HC-05, unfortunately, these devices don't support baud rates below 9600 bits/second. The VIC-20 and the Scott Adam adventure games require 2400 bits/second (although the manual of the game states 1200 baud, but that is simply an error in the manual). So in short, the HC-05 would not be able to work with it, another lesson learned, read the datasheet before you buy something. The costs of the Bluetooth devices are pretty low, so I bought them based on an impulse "I got to have this, buy now!", although not suited for this project, I'm sure they will come in handy for another project.
So I finally did my "homework" and bought a HC-06, that model could go down to 2400 bits/second without problems. I received it on the first day of my vacation. Just in time. Then I started writing an app that would connect to the Bluetooth device and receive the text from the VIC-20. Once the text from the VIC-20 was inside the smartphone, the text would be converted to speech. The whole approach worked, and it was certainly smaller then the raspberry pi sollution and a lot cheaper. A few weeks later I made a little PCB to hold the HC-06 module and some level shifting resistors and a 3.3V regulator. It is shown on the image to the left.
I never wrote an app before, so this was quite an adventure by itself, but somehow I pulled through and made it work. I'll save you the problems and irritations I encountered while.writing my little app. So finally, it's time to play. Commodore has released the following Scott Adams adventure games: Adventure land,.Mission Impossible, Pirate cove, The count, Voodoo castle. Of all the available Scott Adams games, I only own "The count" (boxed), "Mission impossible" (no box) and "Voodoo Castle" (no box). When you look at the boxes you instantly appreciate the detail of the drawings. These pieces of art are not only designed for making you buy it, they also pull you into the story you are about to reveal bit by bit.
I decided to play "The count", but quite quickly after I started the game I was a little disappointed. Speech synthesis itself was great, nothing wrong with that, but the game send everything on the screen to the speech synthesizer. It did not only spoke the text of the adventure, it spoke all the text I entered which became annoying rather quickly. When I wanted to go north, I typed "n". Making the speech synthesizer saying: what shall I do now? At first this seems OK. But after a few minutes, it becomes annoying. Simply by the fact that I already know what I typed (so.that does not need to be spoken). But also because of the.long sentences and the repetitive nature of the text shown. So honestly, the speech synthesis doesn't do the game any good. But then again, that's my humble opinion.
So this new functionality has learned me a lot about writing apps for android, Bluetooth devices and the fact that I will never learn to like.text adventure games. For the people who do like adventure games I do can imagine why they like them, adventures (if properly written) will drag you into the story line just like a book can. The power of the game (or a book) lies in your own imagination..You visualize the environment of the game in your head and not on your screen. Scary is more scary if you think of the things that frighten you the most and are therefore more powerful then any.image or movie. After all, the scariest horror movies are the ones that show the least. Your own imagination is the real.magic behind these kind of games. These games.require your full attention and.are sometimes complex puzzles, so they require a certain way of thinking, exploring perhaps. I rather do the challenge of making the game speak, instead of playing the game. But for everyone who wants to experience this for him/her-self feel free to use my app and hardware sollution as presented on this website. The video below gives a small demonstration of the quality of speech.
Schematic
Here you see the schematic of the adapter, it is so simple that it doesn't really require a PCB. Although it does look much nicer if all components were to be placed onto a PCB. When you build this device, make sure to include the reverse ploarity protection pins also knows as "keys" on the 24-pin edge connector. This way it will not be possible to plug in the connector upside down. In the schematic below you see the location of these keying pins indicated by a black line.
Android application (.APK)
The application is not available on the playstore, but you can download the .APK file and related sources directly as one .ZIP file. The .APK file is the file you'll need to install on your Android phone. You may copy it to your phone using a tool called an APK installer.
Although I've written quite a few programs over the years and consider myself to be experienced in programming. I never written an application for a smartphone before. So this was my first attempt in writing an app. And to be honest, I'm pleased with the result. I've written this application in Android studio as a proof of concept. But I would like to add more functionality, for instance a graphical representation of the audio. This in the form of an oscilloscope image or.a VU-meter as used in the car called KIT from the knight-rider series. But considering I still need to learn a lot in coding apps, I decided to release this version (as shown in the video) so that you do not have to wait any longer. It basically is a Bluetooth serial terminal program that can only receive and prints and speaks all received data. This means that you can use this app to add speech functionality to anything you like. For instance your own diy robot or whatever. As long as it can connect to your smartphone using Bluetooth serial.
Use this on other CBM computers:
The VIC-20 isn't the only computer who can do this, the C64 and the C128 can also use this device. This because these computers have the same userport pinout. Unfortunately, the PET computers have a slightly different pinout than the VIC-20 and therefore cannot use this circuit without modification. For example, the Pin-2 of the userport does not contain +5V on a PET, but a video related signal. So when you plug in this device into the PET, the screen will go black and nothing happens.
Additional information for programmers
Using this device and application, it is very easy to add speech to your program. Just 2 lines is enough to make your computer speak. Thanks to the power of your android smart phone. Please be aware of the fact that this device will work with any Commodore computer that has a userport identical to that of the VIC-20. For instance the C64 or the C128.
10 OPEN 1,2,3,CHR$(10):REM OPEN SERIAL PORT @ 2400Baud
20 PRINT#1,"HELLO WORLD":REM SPEAK TEXT (NO OUTPUT TO SCREEN)
Now that example was a bit static and not always efficient for speaking large amounts of text, it would be better to use data statements as shown below, you can imagine that the data statements also must hold additional information for example directions or items in your game. Let your imagination run free and write your own adventure. But this time, use speech synthesis wisely, do not send everything that is printed to the speech synthesizer.
10 OPEN 1,2,3,CHR$(10):REM OPEN SERIAL PORT
20 READ A$
30 IF A$="*" THEN 99
40 PRINT#1,A$:REM SPEAK TEXT
50 PRINT A$:WRITE TO SCREEN
60 FOR L=0 TO 2000:NEXT L
70 GOTO 20
99 END
100 DATA "HELLO WORLD"
110 DATA "THIS IS JUST AN EXAMPLE"
120 DATA "*":REM END OF DATA