← 返回命令列表

Linux command

mpg321 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Play MP3 file

mpg321 [file.mp3]

Play multiple files

mpg321 [file1.mp3] [file2.mp3]

Play from URL

mpg321 [http://example.com/audio.mp3]

Play with shuffle

mpg321 -z [*.mp3]

Play with volume adjustment

mpg321 -g [50] [file.mp3]

Quiet mode

mpg321 -q [file.mp3]

Output to WAV file

mpg321 -w [output.wav] [input.mp3]

Loop playback

mpg321 --loop [3] [file.mp3]

说明

mpg321 is a command-line MP3 player, a free clone of mpg123. It decodes and plays MPEG audio files using the libmad library. The player supports local files, playlists, and HTTP streams. Shuffle mode randomizes playback order. Loop mode repeats tracks or playlists. WAV output decodes MP3 to uncompressed audio, useful for burning CDs or converting formats. Combined with pipes, it can feed audio to other programs. The remote control mode accepts commands on stdin, enabling integration with front-end applications. Commands control playback, seeking, and volume. Gain adjustment scales the audio output. Values above 100 amplify and may cause clipping. The setting helps normalize volume across tracks.

参数

-w _FILE_
Output to WAV file instead of playing.
-g _GAIN_
Audio gain as percentage (default 100, higher values amplify).
-z
Shuffle playlist.
-q, --quiet
Quiet mode.
--loop _N_
Loop playback N times.
-@ _FILE_
Read playlist from file.
-o _DRIVER_
Audio output driver.
-a _DEVICE_
Audio device.
-b _SIZE_
Buffer size in kilobytes.
-r
Use remote control interface.
-s
Output to stdout (for piping).
-v
Verbose output.

FAQ

What is the mpg321 command used for?

mpg321 is a command-line MP3 player, a free clone of mpg123. It decodes and plays MPEG audio files using the libmad library. The player supports local files, playlists, and HTTP streams. Shuffle mode randomizes playback order. Loop mode repeats tracks or playlists. WAV output decodes MP3 to uncompressed audio, useful for burning CDs or converting formats. Combined with pipes, it can feed audio to other programs. The remote control mode accepts commands on stdin, enabling integration with front-end applications. Commands control playback, seeking, and volume. Gain adjustment scales the audio output. Values above 100 amplify and may cause clipping. The setting helps normalize volume across tracks.

How do I run a basic mpg321 example?

Run `mpg321 [file.mp3]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -w _FILE_ do in mpg321?

Output to WAV file instead of playing.