准备工作一:
编译madplay
首先解压三个压缩文件
[root@localhost ~]# cd
/work/projects/sound/
[root@localhost sound]#
ls
libid3tag-0.15.1b.tar.gz
libmad-0.15.1b.tar.gz madplay-0.15.2b.tar.gz
[root@localhost sound]# tar
xzf
libid3tag-0.15.1b.tar.gz //从名字上看是个库
[root@localhost sound]# tar
xzf libmad-0.15.1b.tar.gz //这个也是库
[root@localhost sound]# tar
xzf
madplay-0.15.2b.tar.gz //这个是应用程序,它依赖这两个库
[root@localhost
sound]#
[root@localhost sound]# cd
libid3tag-0.15.1b
[root@localhost
libid3tag-0.15.1b]# ./configure--host=arm-linux
--prefix=/work/projects/sound/tmp
configure: WARNING: If you
wanted to set the --build type, don't use--host.
If a cross compiler isdetected then cross
compile mode will be used.
checking for a BSD-compatible
install... /usr/bin/install -c
checking whether build
environment is sane... yes
然后再
make
make install
再按照上面的方法进入libmad-0.15.1b文件夹编译
./configure --host=arm-linux
--prefix=/work/projects/sound/tmpLDFLAGS="-L/work/projects/sound/tmp/lib"
CFLAGS="-I/work/projects/sound/tmp/include"
注意:
-L/work…..
这个-L与/之间没有空格.
然后再
make
make install
把tmp/bin/* tmp/lib/*so*
-d把库文件复制到开发板lib文件夹,bin文件复制到开发板的bin文件夹
# madplay --tty-control
/mnt/mp3/beyond.mp3
MPEG Audio Decoder 0.15.2
(beta) - Copyright (C) 2000-2004 RobertLeslie et
al.
s3c2410-uda1341-superlp:
audio_set_dsp_speed:44100 prescaler:66
Artist:
Beyond£¨»Æ¼ò¾Ô£©
Album:òôàÖμîìÃMusicPalace
s3c2410-uda1341-superlp:
audio_set_dsp_speed:44100 prescaler:66
到这里时候测试下自己的开发板能否播放mp3音乐。
注意事项:确保自己的开发板已经有声卡了,想提高播放音乐的音量不能用madplay提供的方法(声音加大会破掉,而且音质会变得很差),如果你的开发板有QT界面直接调整音量滑块。