Last active
August 29, 2015 14:01
-
-
Save shamim71/0dbe4f4c5a2e3ee084a9 to your computer and use it in GitHub Desktop.
Playing sound file in Raspberry PI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Installaing Driver | |
sudo apt-get install alsa-utils | |
#Loading driver module | |
sudo modprobe snd_bcm2835 | |
#Pointing output port to analog output. | |
# sudo amixer cset numid=3 <n> | |
# Where <n> is the required interface : 0=auto, 1=analog, 2=hdmi. To force the Raspberry Pi to use the analog output : | |
sudo amixer cset numid=3 1 | |
# Getting a sample audio file | |
sudo wget http://www.freespecialeffects.co.uk/soundfx/sirens/police_s.wav | |
#Playing the file | |
sudo aplay police_s.wav | |
Reference: | |
http://www.raspberrypi-spy.co.uk/2012/06/raspberry-pi-speakers-analog-sound-test | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment