This page describes how to play mp3 format audio streams and files on your Didj using madplay, a command-line mp3 player.

This page describes how to play mp3 format audio streams and files on your Didj using madplay, a command-line mp3 player.

==Prerequisites==

==Prerequisites==

−

In this example we assume you are using the buildcross-generated cross compiler environment http://elinux.org/Didj_Build_Environment and have properly set your environment variables for cross-compilation.

+

[[LeapFrog_Pollux_Platform:_Build_Environment| Set up the Build Environment]]

''Note: Edit 'configure', removing '-fforce-mem' from the CFLAGS directive with the following command.''

−

configure --host=arm

+

$ sed -i -e '/fforce-mem/d' configure

−

</code>

+

+

and then type

+

$ ./configure --host=arm

−

''Note: Edit the Makefile, removing '-fforce-mem' from the CFLAGS directive.''

then type

then type

−

<code>

+

$ make

−

make

+

−

</code>

+

−

+

after which, type

after which, type

−

<code>

+

$ cp .libs/libmad.a .

−

cp .libs/libmad.a .

+

−

</code>

+

(note the trailing dot)

(note the trailing dot)

Line 84:

Line 72:

Enter the directory madplay-0.15.2b and type

Enter the directory madplay-0.15.2b and type

−

<code>

+

$ ./configure --host=arm

−

configure --host=arm

+

−

</code>

+

−

+

then type

then type

−

<code>

+

$ make

−

make

+

−

</code>

+

Finally, strip the madplay file as follows:

Finally, strip the madplay file as follows:

−

+

$ arm-linux-uclibcgnueabi-strip madplay

−

<code>

+

−

arm-linux-uclibcgnueabi-strip madplay

+

−

</code>

+

Line 105:

Line 85:

Make sure the lightning application is stopped.

Make sure the lightning application is stopped.

−

On the Didj:

−

<code>

−

/etc/init.d/lightning stop

−

</code>

+

'' On Didj ''

+

$ /etc/init.d/lightning stop

==Playing MP3s==

==Playing MP3s==

Line 115:

Line 93:

To execute madplay,

To execute madplay,

On the Didj:

On the Didj:

−

<code>

+

# madplay yourfile.mp3

−

madplay yourfile.mp3

+

−

</code>

+

==Streaming MP3s==

==Streaming MP3s==

−

−

In order to stream a networked MP3 stream, first set up networking. (You can using the information in http://elinux.org/Didj_Networking_HOWTO and http://elinux.org/Route_Your_Didj to set up networking and routing)

To stream audio, wget a stream (the example is NPR news), while piping the stream through madplay:

To stream audio, wget a stream (the example is NPR news), while piping the stream through madplay:

−

+

# wget -O - http://npr.ic.llnwd.net/stream/npr_live24 | ./madplay -

−

<code>

+

−

wget -O - http://npr.ic.llnwd.net/stream/npr_live24 | ./madplay -

+

−

</code>

+

Note that .pls files are not supported in madplay. (but you can open them with a text editor to get the URL)

Note that .pls files are not supported in madplay. (but you can open them with a text editor to get the URL)