|Bluetooth Android Speech Synthesis|
owner of a VIC-20 and a few Scott Adams adventure games, I wondered how
the function of speech synthsis (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
the Votrax type 'n talk could convert text directly into speech while
using only a single serial line. This made the device very
connect to different types of computers... but also very expensive.
But the biggest advantage would be that adding speech to an
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
any conversion) and directly spoken by the device. A great device for
it's time, but out of reach for most of us.
the Votrax type 'n talk in combination with the Scott Adams
adventure games, you could add a new dimension, 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 suprised. 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 snuggly into a
project box. You must connecti it to the userport of a VIC-20
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 realised
that is not the point. This approach is great because the
raspberri 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,- 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 powerfull 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... @#$!^&$# (sorry for cursing) but my phone did not support this type of bluetooth. A lesson learned the hard way. So I bought a classic bluetooth to serial device the HC-05, unfortunately, these devices don't support baudrates below 9600 bits/second. The VIC-20 and the Scott Adam adventure games require 2400 bits/second (although the manual of the game states 1200baud, 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 2400bits/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 dissapointed. Speech synthesis 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 anoying rather quickly. When I wanted to go north, I typed "n". Making the speech synthesizer saying: n <the text of the new scene>, what shall I do now? At first this seems ok. But after a few minutes, it becomes anoying. 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 storyline 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 powerfull 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.
of Userport bluetooth serial port adapter|
Here you see the schamtic of the adapter, it is so simple that it doesn't require a PCB.
Although it does look much nicer on a PCB. When you vuild this device make sure to include the reverse ploarity protection pins on your connector.
This way it won't be possible to plug in the connector upside down. In the schematic below you see the location of these pins indicated by a black line.
|Download Android application (.APK) and sourcecode file(s):|
The application is not available on the playstore, but you can download from my GitHub page: https://github.com/JanDerogee/Bluetooth-android-speech-synthesis
The file you need to install on your Android phone is an .APK file. You may copy it to your phone using an APK installer.
Although I've written quite a few programs and consider myself a skilled programmer. I never written an application for a smartphone before. So this was my first attempt in writing an app. And to be honest, I glad 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.
The PET computers have a slightly different pinout then 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 @ 2400BaudNow this example was a bit static and not 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