The Speaker and audio amp is working! I managed to get the TNG click sound to take up only 10kB of memory so I can play it every time a communication is started. Here's the procedure:
- I found a TNG click sound at trekcore.com: http://trekcore.com/audio/
- I brought it into Audacity (http://audacity.sourceforge.net/) and trimmed the extra dead space at the beginning and end of the file to save memory.
- I then optimized the data-rate as low as I could. The click sound is pretty high frequency so I could only get it down to 32ksampels/second before it started sounding poor.
- I them exported it as an unsigned 8-bit WAV file
- I used Sox to trim extra data from the file: http://sox.sourceforge.net/
- Finally, I used wav2C to create a program memory constant of the wav file: https://github.com/olleolleolle/wav2c
- I my main code, I dump the audio, sample by sample with a 32kHz timer.
I'll post the wav file so you can hear what I came up with with only 10kB or program memory space.