Last summer I used an Arduino WAV shield for a project. It worked fine but was kind of big and expensive. It would be nice to have something cheap(er) and not necessarily tied to a microcontroller (Arduino).
I stumbled on the Sparkfun MicroSD Audio-Sound Breakout Module a few weeks ago. It looked like it could be useful for future practical jokes.
After doing some research, setting this breakout module up to work by itself should be very easy (and will be unless you happen to be me as I will explain). The main complaint I’ve seen is that getting the sound files onto the microSD card is difficult.
My primary reference for getting the hardware running was
My hardware setup is nearly identical to his. Here is the schematic I used for my hardware:
Here is my actual hardware:
The 9V battery is converted to 3.3v by the power supply. 3 little push buttons are used for prev/play/next.
Getting Some Test Sound Files
The docs says it will support up to a 1GB card. I’ve seen people reporting they can get up to 2GB to use. I happened to have an old 512MB card so that is what I used.
You must format the card using FAT16 (not FAT32). I turned OFF quick format just in case that makes a difference.
The files on the SD card must be in the format nnnn.ad4 such as 0001.ad4, 0002.ad4, etc. Leading 0’s are required. Someone said there can be gaps. I haven’t tried it myself.
Since creating your own sound files is not particularly easy, I decided to find some on the web first. Here is a sound file that is known to work.
I put that file on the microSD card, properly ejected the card from my PC, and placed the microSD card into the breakout board.
Everything looked good, I turned it on, I tried pressing buttons. Nothing. I messed around for a long time and got nothing. This is such a simple device, it should work.
After checking everything carefully and finding no obvious problem, I connected a different speaker in desperation. Success!
I was initially using an 8Ω .5W speaker. I then tried an 8Ω .25W speaker (from a musical birthday card) and that worked. I then tried a 4Ω 5W speaker (pictured) and 4Ω 2W speaker. Those worked. Others say the mfg recommends 16Ω speakers, which I don’t have. But others have had luck with 8Ω speakers.
I’m kind of surprised my speaker didn’t work. I don’t know for a fact the speaker is good, and others are having luck with that size, so I will assume my speaker is bad.
Creating Your Own Sound Files
Once I knew I could play sound files that are known to work, it was time to try making my own.
First, open the file in Audacity and then convert it to mono:
Now click on Effect | Amplify
For amplification enter -1:
That will reduce the wave form some. Now press control-R repeatedly until you get the wave form to max out at about the .5 level:
Now set the format of the output file to 16bit (click where the red box is to get this drop down menu):
Finally change the sampling rate to 32000Hz:
and you can now export this file as a WAV file:
The last step is to convert the resulting WAV file into AD4 format. This is done with the AD4CONVERTER utility. This is a command line utlity so use it like this (I am converting XXX.WAV to 0000.ad4 here):
This is kind of clumsy, but it was the same way for the WAV shield as well. If your sound file sounds really bad, reduce the volume further and be sure you are creating a 16bit sound file at 32000Hz.