Moene's Main Site

Game audio, retro synth, melody IC, and random thoughts

Improving My Sub 90 Cents Speech Module

The MegaHits is a low-cost (less than 90 cents) speech controller designed by me as a personal project that’s capable of playing back long segments of audio clips and can be programmatically controlled by external microcontrollers with it’s custom communication interface. The logic part of the speech controller can be debugged and altered with a debug probe while the speech data is OTP(one-time-programmable). While MegaHits is very good at speech playback, it doesn’t have any lightning control capability and in this project, I am facing a challenge with controlling an LED with a speech controller for an arts project.

MegaHits and its single transistor amplifier in action. Playing a very long audio clip with minimal hardware. The transistor is not soldered on the module in this case, it’s behind the speaker. The storage chip on this unit is on a socket, which enables me to swap audio clips. Music credit: Union!! – 765 MILLION ALLSTARS

I started my project by forking the existing MegaHits firmware source code, which was written in low-level c for performance and size optimisation(the controller is very limited, with 128 bytes of RAM, 1KB of XDATA, and 12KB of FLASH ROM). After inserting the controlling code for the LED PWM and some appropriate delay, I found that the firmware doesn’t work on my development board. After some research and debugging I found that to controller audio and lightning individually I need to enable the “independent mode” of the PWM controller. I am using a single transistor(S8050 in my case) here to amplify the audio to the speaker since MegaHits’ audio algorithm is specifically designed for this kind of low-cost single transistor amplifier.

MegaHits module with LED and speaker working. You can hear the dripping sound from the speaker.

While perfectly suitable for lo-fi speech and music playback, It’s not designed for Dripping Cave Simulator’s application. The audio circuitry continues working while the drip cave simulator waiting for the next drop to happen, which wastes a lot of power. Shutting down and powering up the audio circuitry when needed is a solution but it creates a loud pop when doing so. To resolve that, I altered the audio synthesizing code and gradually turn the circuit up and down when a power event happens. This modification proved to be very effective both saving power and against the annoying popping noise. Which will be merged back to the main audio-only codebase. To make the sound more realistic, I also implemented a rate changing algorithm to randomly adjust the speed and the pitch of the audio.

(Advisor for the art project: Prof Joshua Rosenstock https://www.joshuarosenstock.com/)


Posted

in

by

Tags: