Close

Speaker and Click Sound

A project log for Star Trek Communicator Badge

In the true spirit of Star Trek, this communicator badge is completely autonomous, while fitting in the form factor of an original badge

JoeJoe 02/27/2017 at 03:290 Comments

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:

  1. I found a TNG click sound at trekcore.com: http://trekcore.com/audio/
  2. 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.
  3. 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.
  4. I them exported it as an unsigned 8-bit WAV file
  5. I used Sox to trim extra data from the file: http://sox.sourceforge.net/
  6. Finally, I used wav2C to create a program memory constant of the wav file: https://github.com/olleolleolle/wav2c
  7. 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.

Discussions