It is a suggested guide to try for learning the basic and understand which components needed for which work. Electronic components are essentially cheap and not everyone on this earth has huge money to spend to learn electronics. Here is how to play MP3 on Arduino with no shield, no SD card at lower bit rate for few seconds. What normally used for projects like our Arduino door bell is a buzzer. In this project, it is better to have a small speaker instead of a buzzer. Buzzer can deliver unexpected result. Basically an Arduino UNO is not really to play sound with a 16mhz microcontroller power to process and play sound at 64kbit or higher bit rate per second rate. Space on the microcontroller is also not huge, hardly around 64kb space will be available for a MP3. 0.5Watt 8 Ohm speakers are good enough. Any speaker actually works.
How To Play MP3 On Arduino With No Shield, No SD Card
Software
So, in order to play MP3, at software part we need to decrease the bit rate of MP3 to lower value 8kbit. Also, we will need to install an Arduino library :
---
1 | https://github.com/muayyad-alsadi/avr_sound |
Install that into your libraries. Then we need some application like Audacity which will make any Stereo Track to Mono, change the Bit Rate to 8000hz and export the File as “Other uncompressed files” (in case of Audacity change the settings to RAW (header-less) and Unsigned 8-bit PCM then export). This way, you’ll get a .raw
file.
In our downloaded avr-sound
library there other tools like a python application named snd2h.py
. We need to process that .raw
audio file with that python application from command line tool in the following format to convert it into a .h file
(which we will be able to upload via Arduino IDE in later stage) :
1 | python snd2.py audio-file.raw |
We will use this kind of sketch/code to upload that Audio :
1 2 3 4 5 6 7 8 9 10 11 12 | #include <avr_sound.h> #include "audio-file.h" void setup() { avr_sound_init(); } // the loop routine runs over and over again forever: void loop() { play_myaudiofile(); delay(500); } |
Hardware
As for hardware, with few resistors, a small speaker and an NPN transistor, we can create a basic circuit :
Tagged With arduino play mp3 sound file , mp3 on arduino , arduino play mp3 , arduino play mp3 no sd , arduino play sound without sd card , paperuri:(16c61ca702e56e77e082c70b7f45a0fa) , arduino mp3 player and no sheiled , arduino mp3 without card , как управлять sd картой arduino , arduino movi upload mp3