Introduction: Implementation of MP3 Player Using Raspberry Pi

Implementation of MP3 player using Raspberry Pi

Trough this instructable you can play mp3 files on a USB flash drive using raspberry pi.


1- Raspberry Pi B rev2.

2- SD card with Raspbian OS.

3- Resistor 10 k ohm (2).

4- Led (1) " indicates existence of usb flash drive".

5- Resistor 330 ohm (1).

6- Push button (2).

7- USB flash drive contains mp3 files.

8- Wires.

Steps of operation :

1- check existence of usb flash drive.

2-scan the contents of the drive for mp3 files

3-play individual files according to your control.

Source Code :

This program was written in C.

Before compiling code you must install :

*sudo apt-get install mpg321

*sudo apt-get install libusb-1.0-0-dev

and also install wiringPi library

To compile this project with gcc compiler type in terminal:

"gcc -Wall mp3.c vector.c usbcheck.c getpath.c -lpthread -lusb-1.0 -lwiringPi -o mp3"

To make program run on startup :

type in terminal "sudo nano /etc/rc.local"

and add this line to this file " sudo /path/to/folder/mp3 & "

in my case " sudo /home/pi/mp3player/mp3 &"

See project on youtube "video" :

This code is an initial release and many blocks need update so Your comments and suggestion are welcome