← 返回命令列表

Linux command

mpg123 命令

文件

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

常用示例

Play

mpg123 [path/to/file1.mp3] [path/to/file2.mp3]

Example

cat [file.mp3] | mpg123 -

Example

mpg123 -z [path/to/*.mp3]

Loop

mpg123 --loop [3] [path/to/file.mp3]

Example

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

Example

mpg123 [http://example.com/stream.mp3]

说明

mpg123 is a fast, free console MPEG audio player supporting layers 1, 2, and 3. It plays local files, reads from stdin, and streams from HTTP URLs. The player supports various audio output modules including ALSA, PulseAudio, and OSS. Terminal control mode (-C) enables interactive playback control with keyboard commands for seeking, volume adjustment, and track navigation.

参数

-o, --output _module_
Select audio output module
-a, --audiodevice _device_
Specify audio device
-w, --wav _file_
Write output to WAV file
-s, --stdout
Write raw audio to stdout
-r, --rate _rate_
Set sample rate
-m, --mono
Decode to mono
-z, --shuffle
Shuffle playlist
-Z, --random
Continuous random playback
--loop _count_
Repeat playback count times
-@, --list _file_
Read playlist from file
-k _frames_
Skip initial frames
-n _frames_
Decode only specified number of frames
-C, --control
Enable terminal control keys
-q, --quiet
Suppress output messages
-v, --verbose
Increase verbosity
-t, --test
Test decode without audio output
-b, --buffer _size_
Audio buffer size in KB
-E, --equalizer _file_
Apply 32-band equalizer from file
-2, --2to1
Downsample at 2:1 ratio (halve output sample rate).
-4, --4to1
Downsample at 4:1 ratio.
-g, --gain _value_
Set audio hardware output gain.
-f, --scale _factor_
Set scaling factor for output samples (volume).
--au _file_
Write output as Sun AU file.
--cdr _file_
Write output as raw CDR file.

FAQ

What is the mpg123 command used for?

mpg123 is a fast, free console MPEG audio player supporting layers 1, 2, and 3. It plays local files, reads from stdin, and streams from HTTP URLs. The player supports various audio output modules including ALSA, PulseAudio, and OSS. Terminal control mode (-C) enables interactive playback control with keyboard commands for seeking, volume adjustment, and track navigation.

How do I run a basic mpg123 example?

Run `mpg123 [path/to/file1.mp3] [path/to/file2.mp3]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -o, --output _module_ do in mpg123?

Select audio output module