22/9/2016
ArduinoTone&MP3SoundwithNoShield
Arduino Tone & MP3 Sound with No Shield
Published 7 months ago by Mate Marschalko
Arduinos are not designed to play sound on their own as its quite a dicult task for
that 16mhz microcontroller chip you have on an UNO to process and play sound at
64 128kbit per second rate which is the bit rate of a regular MP3 le.
However if you decrease the bit rate to only 8k and down sample the le then it is
possible with the help of only two digital output pins and a few resistors. As you will
see the sound volume will be quite low so we will build a simple ampli er with an
NPN transistor.
Play sound
The rst thing we do is build the circuit that will be connected to your mini speaker.
For that you will need 6 resistors with the same amount of resistance and a few
jumper wires.
http://www.webondevices.com/arduinotonemp3soundwithnoshield/
1/6
22/9/2016
ArduinoTone&MP3SoundwithNoShield
Back
Blog Resources
Next thing to do is download and install the library called avr-sound created by
Muayyad Alsadi. Download the les from the repository and install it or manually
place it into your libraries folder.
Custom audio les
Adding your own audio les is not as simple as uploading an MP3 le. You will need
to down sample the le rst. Audacity is a free application that lets you do that.
After recording and opening your audo le in Audacity rst click Track / Stereo
Track to Mono. Next change the Project Rate to 8000hz at the bottom of the project
window. Finally go to File / Export Audio and select Other uncompressed les under