最近正在学英语,用树莓派每天早上7点播放一段新概念英语课文。然后晚上十一点提醒睡觉了。用手机录了一段睡觉语音。
1.最开始用的是sox
sudo apt-get install sox libsox-fmt-all
使用play命令,play test.mp3。还可以repeat参数,可以播放文件夹。
问题:播放的时候有时候会莫名其妙的卡主?
解决:找不到原因
2.ffmpeg
第二个想到的就是强大的ffmpeg,貌似没有apt-get install。没关系,自己下源码
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
./configure --prefix=/usr/local/
make && sudo make install
结果出来没有ffplay
安装SDL库
问题:Failed to create window or renderer: Could not initialize OpenGL / GLES library
解决方法:换一个。。
3.mplay
问题:不知道为什么mplay 播放音乐时候一卡一卡的??
3.omxplayer
据说omxplayer 是专门针对树莓派的GPU的播放器。
但是好像没有办法播放文件夹。
解决方法:写个脚本
find /mnt/smb/pc/pi/cornSound/morning/english/* -name "*mp3" |xargs -i omxplayer {}
一句话搞定 完美!