Monday 2 April 2018

How to Play Audio on the Raspberry PI

PLAYING AUDIO ON THE RASPBERRY PI

To play an MP3 file, navigate to the location of the .mp3 file in the terminal using cd and then type the following command:
omxplayer example.mp3
This will play the audio file example.mp3 through either your monitor's built-in speakers or your headphones, connected via the headphone jack.
If you need an example file you can download one from here using the following command:
wget http://rpf.io/lamp3 -O example.mp3 --no-check-certificate
If you cannot hear anything, make sure your headphones or speakers are connected correctly. Note that omxplayer doesn't use ALSA and so ignores the audio configuration set by raspi-config or amixer.
If omxplayer's auto-detection of the correct audio output device fails, you can force output over HDMI with:
omxplayer -o hdmi example.mp3
Alternatively, you can force output over the headphone jack with:
omxplayer -o local example.mp3
You can even force output over both the headphone jack and HDMI with:
omxplayer -o both example.mp3

No comments:

Post a Comment

How to install google-chrome in redhat without redhat subscription

Install google-chrome in redhat  Download the .rpm file of chrome https://www.google.com/chrome/thank-you.html?installdataindex=empty&st...