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?
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.Sign up to join this community
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