mpg123 備忘録

Environment
Photo by hyt.

前回の記事で SoX を cygwin でコンパイルしましたが,単に mp3 を再生するだけだと,昔から mpg123 があったなということで,ついでにこれもコンパイルしてみることにしました.

mpg123, Fast MP3 Player for Linux and UNIX systems

調べてみて驚いたのですが,現在でも比較的頻繁に更新されています.本原稿執筆時点だと,2016/6/30 日の ver 1.23.6 が最新です.Windows 用のバイナリも x86 と x64 双方の分がありますが,今回は試しに cygwin 上でコンパイルしてみます.

まず,ソースコードを取ってきます.

$ wget https://sourceforge.net/projects/mpg123/files/mpg123/1.23.6/mpg123-1.23.6.tar.bz2
$ tar -jxvf mpg123-1.23.6.tar.bz2
$ cd mpg123-1.23.6

configure のオプションを眺めてみると,yasm で最適化できそうなので,事前に setup.exe で

  • yasm
  • yasm-devel

を入れておきます.で,以下の通りコンパイルしました.

$ ./configure --enable-yasm  --with-cpu=x86-64 --with-default-audio=win32_wasapi
$ make
$ make install

インストールされるファイルは以下の通りです.

/usr/local/bin/cygmpg123-0.dll
/usr/local/bin/cygout123-0.dll
/usr/local/bin/mpg123-id3dump.exe
/usr/local/bin/mpg123-strip.exe
/usr/local/bin/mpg123.exe
/usr/local/bin/out123.exe
/usr/local/include/fmt123.h
/usr/local/include/mpg123.h
/usr/local/include/out123.h
/usr/local/lib/libmpg123.dll.a
/usr/local/lib/libmpg123.la
/usr/local/lib/libout123.dll.a
/usr/local/lib/libout123.la
/usr/local/lib/mpg123
/usr/local/lib/mpg123/output_dummy.dll
/usr/local/lib/mpg123/output_dummy.dll.a
/usr/local/lib/mpg123/output_dummy.la
/usr/local/lib/mpg123/output_oss.dll
/usr/local/lib/mpg123/output_oss.dll.a
/usr/local/lib/mpg123/output_oss.la
/usr/local/lib/mpg123/output_win32.dll
/usr/local/lib/mpg123/output_win32.dll.a
/usr/local/lib/mpg123/output_win32.la
/usr/local/lib/mpg123/output_win32_wasapi.dll
/usr/local/lib/mpg123/output_win32_wasapi.dll.a
/usr/local/lib/mpg123/output_win32_wasapi.la
/usr/local/lib/pkgconfig
/usr/local/lib/pkgconfig/libmpg123.pc
/usr/local/lib/pkgconfig/libout123.pc
./usr/local/share/man/man1/mpg123.1
./usr/local/share/man/man1/out123.1

使い心地ですが,コマンドラインから mpg123 *.mp3 とすればタイムラグなく再生してくれるのはとても便利です.日本語ファイル名や id3tag 等の表示も問題が無いようです.なお,再生中のコントロールは h と押すと

 -= terminal control keys =-
[s] or [ ]      interrupt/restart playback (i.e. '(un)pause')
[f]     next track
[d]     previous track
[]]     next directory (next track until directory part changes)
[[]     previous directory (previous track until directory part changes)
[b]     back to beginning of track
[p]     loop around current position (don't combine with output buffer)
[.]     forward
[,]     rewind
[:]     fast forward
[;]     fast rewind
[>]     fine forward
[<]     fine rewind
[+]     volume up
[-]     volume down
[r]     RVA switch
[v]     verbose switch
[l]     list current playlist, indicating current track there
[t]     display tag info (again)
[m]     print MPEG header info (again)
[h]     this help
[q]     quit
[c] or [C]      pitch up (small step, big step)
[x] or [X]      pitch down (small step, big step)
[w]     reset pitch to zero
[k]     print out current position in playlist and track, for the benefit of some external tool to store bookmarks

Also, the number row (starting at 1, ending at 0) gives you jump points into the current track at 10% intervals.

と表示されますので,すぐに分かります.なお,一緒に out123 というプログラムもインストールされますが,これは wav ファイルの再生用の様ですね.

2017/5/28 追加:mpg123 ですが,Cygwin の標準パッケージに含まれていることに今日気が付きました.これって昔は入ってなかったと思うんですが…….標準パッケージだとアップデートが楽なので make uninstall して入れ替えました.めでたしめでたし.

Environment
スポンサーリンク
Following hyt!
タイトルとURLをコピーしました