A couple of weeks ago, I got a WIRELESS PROTO SHIELD, SD CARD SLOT from newark/element14 with the goal of enabling us to play longer sound clips for our secret project. On Monday, I met with the students and we worked on this for a bit.
At first, I tried to keep using the PCM Library we had been experimenting with, but found that it required reading the entire sound clip into memory before playing it, which wouldn't solve our problem. I googled around a bit and found this blog post, which explains how to do it with the TMRpcm library.
In just a few minutes, I had recorded some sound clips and gotten them to play. The only trick was finding the right way to export the clip from Audacity: Set the project rate to 16000, record, export as Other Uncompressed Format, and set "Options" to Header: WAV (Microsoft) and Encoding: Unsigned 8 bit PCM. They are much, much clearer than our previous attempts using PCM and appear to be able to be of arbitrary length. The only downside is that the arduino can't do anything else while it's playing the sound clip, but that shouldn't be fatal to this purpose.
- Steven D. Brewer's blog
- Log in to post comments