mpg123 - Play MPEG 1.0 / 2.0 Layer-1, -2, -3 audio files

grammar

mpg123 [ -tscvqy01m24 ][ -b size ][ -k num ][ -n num ][ -f factor ][ -r rate ][ -g gain ][ -a dev ][ -o s | -o h | -o l ][ -d n ][ -h n ][ -p proxy ][ -@ file ] file ... | URL ... | -

description

mpg123 from one or more files or URL read MPEG-1/2 audio bit stream (if specified `- 'option is read from standard input), and then using the audio playback device (the default), or sending the decoded result to standard output.

Options

mpg123 . receiving the traditional one-letter POSIX-style options, and long word GNU style options for receiving these two options are to '- and' - start with "."

-t, --test
Test mode the audio stream is decoded but not output.
-s, --stdout
The decoding result to the standard output, instead of using an audio device to play. If mpg123 is not supported by your audio hardware, you can try this option, then, mpg123 native byte order (host byte order) stereo outputs 16-bit linear PCM (pulse Code modulation) audio data bare (without header).
-c, --check
A filter for each frame bounds checking, such as the occurrence of the report.
-v, --verbose
More information is displayed during playback, such as the display frame number currently being decoded.
-q, --quiet
Quiet mode does not display diagnostic information.
-y, --resync
If the input file error occurs, the resynchronize and continue decoding. In addition, MPEG files that the file header is damaged, usually mpg123 would refuse to play and show 'Illegal header', but if this option is specified, mpg123 file attempts to damage head to recover and play CAUTION: damaged MPEG file sharp shrill noise may occur during playback to damage at the sound if excessive, could damage the speakers.
-0, --single0; -1, --single1
0 only (left) or a channel (right) channel is decoded. This option is only valid for two MPEG stereo audio stream.
-m, --singlemix
The two-channel mixer. This option is only valid for a stereo MPEG Layer-3 audio stream, and can save some CPU time than full stereo decoding.
-2 , --2to1 ; -4 , --4to1
When the sampling rate of the output stream will be up to standard 1/2 (22kHz) or 1/4 (11kHz). These two options may reduce some of the load on the CPU, but the sound quality is reduced (at least 11kHz sample rate hard to hear).
-b size, --buffer size
With size specifies the size of the output buffer, in kilobytes. This option is usually to avoid the sound caused by the frequent phenomenon of intermittent operation of the system output. Size value less than 300 is pointless, and suggest that at least take 1024 (i.e., use of 1Mb buffer, the buffer can be equivalent to 6 seconds of audio data). size the default value is 0, i.e. no output buffers.
-k num , skip num
Skip the first num frame. When this option is not specified, the default start decoding from the first frame.
-n whether , --frames whether
Only the former num decode the frame. When this option is not specified, the default for the entire audio stream is decoded.
-f factor, --scale factor
Factor change scale factor value (the default value is 32768).
-r rate, --rate rate
Rate set the sample rate (default is automatically set). After using this option, mpg123 will automatically slew rate is not dependent on a constant rate of MPEG stream bit rate. This option should be used together --stereo or --mono .
-g gain, --gain gain
Set audio hardware output gain GAIN (the default is unchanged).
-a dev, --audiodevice dev
Specifies the audio device The default audio device and system configuration related (usually / dev / audio or / dev / dsp), if the system has multiple audio devices and the default not you want that, you can use this option .
-o s, --speaker
The sound exporting to the speaker on the motherboard.
-o h, --headphones
Export sound to the headset connector.
-o l, --lineout
The sound exporting to the Line-Out connector.
-d n, --doublespeed n
Each of n frame playing a. This will play speed MPEG stream is increased to the normal speed of n times, so as to generate special sound effects. This option can be --halfspeed options used in combination to achieve a similar three play every four (Translator's Note: designated -d 4 -h 3). If the effect of using this option, do not expect the sound quality will be good.
-h n, --halfspeed n
The playback of each frame are n times. This will reduce the playback speed is a normal MPEG stream velocity . 1 / n , which can generate special sound effects. This option can be --doublespeed options used in combination to achieve a similar three players each 2 (Translator's Note: designated -h 2 -d 3). If the effect of using this option, do not expect the sound quality will be good.
-p URL | none, --proxy URL | none
Specifies the Proxy . As a proxy for HTTP requests specified format should be a complete URL (such as "http: //host.domain: port /" ), but the prefix "http: //" is omitted, the port number port (default port 80) and the end of the '/'. If specified as none , the agent is not used, directly to the file server request. more details see "HTTP support" section.
-u auth, --auth auth
If you download a file via HTTP server requires authentication information, by the auth specified in the format "username: password" (without the quotation marks).
-@ file, --list file
From the file file reading will want to play the file specified MPEG audio stream is located and (or) URL, if the command line you also specify other documents and (or) URL, also to include it into the playlist. If the specified file to `- 'rather than a regular file name, mpg123 from the standard input file name and (or) URL, or read a URL points to the playlist file Note: - @ option can only be used once (if multiple specified, only the last valid).
-z, --shuffle
Shuffle Play command line and the manifest file specified audio file in random order.
--stereo
Forced stereo output.
--reopen
Forced to re-open the audio device after playing a file.
--8bit
Force 8-bit output.
-Z , --random
Totally random play (Translator's Note: the difference between --shuffle option is specified, this option is likely to be repeated several times to play the same file).

Number of operations

mpg123 support the operands following:

file
Specifies the path input files these files must contain a valid MPEG-1/2 Audio Layer-1, Layer-2 or Layer-3 bit stream is specified if - read MPEG data, is further from the standard input ''. , if the "http: //" at the beginning, is considered a specified the URL of (see next section).

HTTP Support

In addition to reading MPEG audio streams from ordinary files and standard input, mpg123 also support access specified by URL (Uniform Resource Locator) files from the World Wide Web (WWW) through a HTTP protocol is a URL to. "Http: //" for the string prefix when mpg123 recognizes this prefix, it tries to open a connection to the appropriate server, and then obtains the corresponding files and decoding and playing. in many cases, from the WWW cache, or so-called directly from the server over the network proxy easier access to files. to take advantage of this facility, mpg123 would in turn check MP3_HTTP_PROXY , the http_proxy and HTTP_PROXY, whether these three environment variables are set, and the first value of the variable is set as a designated agent. If you need your own specify another agent, can be used -p command line option (see "options" section). use -p none option will not use any proxy server directly connected, even in front of the three variables is provided. Notably , in order to obtain from a WWW server and an MPEG audio file play smoothly, there must be sufficiently fast network connections. for example, in order to play rate MPEG files to 128kbit / s, the required network bandwidth should be at least 128kbit / s plus overhead transmission network protocol itself. If the network is often short interruption occurs, you can try using -b specify a buffer option. If your area the network can not reach the required real-time transmission bandwidth of MPEG audio files, you can only use lynx(1) software like download the file to your local hard disk then play it. If the server requires authentication, you can use the -u auth option (see "Options" section) to specify a user name and password.

Interrupt

Any time by pressing Ctrl-C bonds can be interrupted mpg123 running. If you have multiple files in the player, Ctrl-C will terminate playing the current file and starts playing the next file, in which case, if you want to terminate the entire program run, you must double-tap Ctrl-C (in approximately one second). Note that after you press Ctrl-C sound may not disappear immediately, because the system audio device buffer part of the data. this delay with the system varies, but usually no more than 1-2 seconds.

Instructions

lynx(1), sox(1), intro(1)

note

MPEG audio decoding, decoding especially Layer-3 requires a lot of CPU operation order to achieve real-time decoding, your computer should be equipped with at least a Pentium, Alpha, SuperSparc or equivalent processor, but at the same time you can use -singlemix options single-channel decoder, for Layer-3, this number can be a little less CPU load. In addition, you can also consider using -2 and -4 options. If these methods do not work, try using -s option to decode the results to standard and directs the output to a file, and then play the file and then the appropriate tool. you may use sox (1) of this tool, it can convert the file into a format that your audio player used. there point is mpg123 always outputs 16-bit stereo data (if specified -0 or -1 a options, two-channel stereophonic data are the same). If the system hardware requirements other formats, such as 8-bit mono data can also use the SOx (. 1) was transformed. If your system itself is fast enough to perform real-time decoding, only when the system load is heavy (such as scheduled tasks, user remote login Or start `big 'programs, etc.) pause, you should use the -b option is specified no less than a 1000K-byte buffer.

BUGS

BUG known and limitations:

MPEG-2, Layer-1 and -2 untested. May not work. (Layer-3 should be able to work.)
Does not provide support for the audio stream of free-form.
For Layer-1 support without strict testing.
No the CRC error checking.
does not provide support for audio hardware on DEC Digital Unix, Ultrix and IBM AIX platforms must be used on these platforms -s option. 

Guess you like

Origin www.cnblogs.com/fanweisheng/p/11089506.html