基本介绍:
It can play MPEG1.0/2.0/2.5 layer I, II, II(1, 2, 3;-) files (VBR files are fine, too) and produce output on a number ofdifferent ways: raw data to stdout and different sound systems depending onyour platform (see INSTALL).
mpg123 is fast. Any faster software playeris probably based on some hacked mpg123;-)
MPlayer included mpg123 source code in it'smp3lib and we have to be thankful for the MPlayer folks adding SSE, 3DNowExtand AltiVec optimizations over the years, which we were able to backport.
The mpg123 engine is able to decode in fullcompliance to ISO/IEC 11172-3, for all three layers, using floating point orinteger math (the latter since 1.8.1).
使用方法:
Mpg123 is a console program - normally itjust plays a list of files you specify on command line and that's it. See theincluded manpage or
mpg123--help
or, for the full story,
mpg123--longhelp
on command line syntax/options. I encourageyou to check out the --gapless and --rva-album/--rva-mix options:-)
In the simple "mpg123 file1.mp3file2.mp3" mode, the only thing you can do to interact is to press Ctrl Cto skip to next track or end the whole playback if pressing it twice.
Note that this Ctrl C behaviour is specialto this mode; when any of the following is activated, Ctrl C will just kill theprogram like you would expect normally (this changed from earlier versions).
3.2 Advanced Console Usage
You can specify the option -C to enable aterminal control interface enabling to influence playback on currenttitle/playlist by pressing some key:
-=terminal control keys =-
[s] or [ ] interrupt/restartplayback (i.e. 'pause')
[f] nexttrack
[d] previoustrack
[b] backto beginning of track
[p] pausewhile looping current sound chunk
[.] forward
[,] rewind
[:] fastforward
[;] fastrewind
[>] fineforward
[<] finerewind
[ ] volumeup
[-] volumedown
[r] RVAswitch
[v] verboseswitch
[l] listcurrent playlist, indicating current track there
[t] displaytag info (again)
[m] printMPEG header info (again)
[h] thishelp
[q] quit
You can change these bindings to key toyour liking by modifying term.h .
3.参考demo: mpg123.c docexamples 下面的例子libmpg.c等
Wav.c是wav播放和转码,解析的相关接口的实现。
Mpg123towav.c是mpg格式转码成wav的例子
4.开发api:libmpg123.c