Some basic MP3 streaming tests using libCURL, the mpg123 library and the OpenAL API. The primary target is the Raspberry Pi - but these tests should compile and run on most / all Linux systems.
The main dependencies are:
- libCURL
- mpg123
- OpenAL
To install these on a Debian-like system, try the following as root:
apt-get install libcurl4-gnutls-dev libmpg123-dev libopenal-dev
If using the apt repositories for Raspbian GNU/Linux, you may have problems with version 1:1.17.2-4 of libopenal-dev
. Attempting playback with this version yielded an "Illegal instruction" error. If this is the case, you may need to compile OpenAL from scratch.
First of all install CMake.
sudo apt-get install cmake
or
su
apt-get install cmake
Remove the default OpenAL library and header files that are installed.
apt-get remove libopenal*
Then download a recent version of OpenAL soft from either the website or Github repository. If using the tarball from the website, for example, the following should work.
tar xf openal-soft-1.18.2.tar.bz2
cd openal-soft-1.18.2
cd build
cmake ..
make
sudo make install
Simple type
make openal-test
to build the program, and
make clean
to remove it. (There is no make install
option currently.)
If you prefer to use xmake
( https://xmake.io/ ), use
xmake -r
to build or re-build the project.
The binary should be invoked as follows.
./openal-test <url>
Example:
./openal-test https://designtrail.net/~david/audio/test1.mp3
Type p
to pause / resume. Type q
to exit.