The classic SP0256-AL2 speech chip has featured a few times on these pages, and if you’ve not seen the actual part before, you almost certainly have heard the resulting audio output. The latest Python library from prolific retrocomputing enthusiast [Nick Bild] brings the joy of the old chip to the Raspberry Pi platform, with an added extra trick; support for the venerable AY-3-8910 sound generator as well.
The SP0256-AL2 chip generates vaguely recognisable speech using the allophone system. Allophones are kind of like small chunks of speech audio which when reproduced sequentially, result in intelligible phonemes that form the basis of speech. The chip requires an external device to feed it the allophones at a regular rate, which is the job of his Gi-Pi library.
This speech synthesis technology is based on Linear-predictive coding, which is used to implement a human vocal tract model. This is the same coding method utilized by the first generation of GSM digital mobile phones, implementing a system known as Full-Rate. Both an LPC encoder and an LPC decoder are present on the handset. The LPC encoder takes audio in from the user, breaks it into the tiny constituent parts of speech, and then simply sends a code representing the audio block, but not the actual audio. Obviously there are a few more parameters sent as well to adjust the model at the receiving side. The actual decoding side is therefore not all that dissimilar to what the AY-3-8910 and related devices are doing, except you the user have to create the list of audio blocks up-front and feed the chip at the rate it demands.
Hardware-wise, [Nick] doesn’t document his breadboard build, but the SP0256-AL2 is fairly easy to drive. It is simply a matter of level-shifting the 3.3V logic of the Pi into the 5V domain of the chip, then bit-banging it with a few parallel GPIOs. The PCM audio output is then low-pass filtered and fed into an audio mixer and power amplifier.
The AY-3-8910 can be similarly treated, except it contains its own DAC blocks, so the output is already analog, and you could simply feed the analog outputs directly into the shared mixer with the above.
We’ve featured the AY-3-8910 sound chip before, with this simple hack, which turns an Arduino into a MIDI device. Check out the sweet chiptunes version of Mozart’s Queen of the Night Aria from his Opera ‘The Magic Flute’ in the earlier article linked.
The video after the break gives a (somewhat short) demo of the resulting speech audio you can expect, as if you didn’t already know.