1

I am trying to play mp3 and wav files on the pi from a program written in go.

To date I have had no success. Does anybody have any simple working examples that Have been tested on the pi?

4

I am not sure about Go but if you can launch command line (hidden?) and keep it live while it does its thing then use omxplayer. Not only can it play back video do a specified screen, like HDMI it can also play audio files like MP3, AAC or WAVE.

apt-get install omxplayer

Sometimes its needed to do this.

ldconfig
ln -s /usr/lib/arm-linux-gnueabi/libpcre.so /usr/lib/omxplayer/libpcre.so.1

Because omxplayer uses the hardware GPU its need GPU memory.

In the file /boot/config.txt , add the line gpu_mem=128 or set it using raspi-config

example to stream audio via HDMI

omxplayer -o hdmi Ten_Walls_-_Walking_With_Elephants.mp3
  • 1
    I ended up hacking some code which uses GStreamer which I am assured is far from optimal. However I have used OMXPlayer and agree that this is probably an easier way to go :-) – Dave Appleton Nov 25 '14 at 13:15
  • Awesome. Glad it helped you out, it was the easiest method I found that plays various formats without moaning and easily select the output too :) – Piotr Kula Nov 25 '14 at 14:20
  • 1
    rewrote it to use Omxplayer because the Gstreamer version did not allow cross compilation.... Thanks Again. – Dave Appleton Feb 24 '15 at 20:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.