📄 sox.txt
字号:
SoX(1) SoX(1)NAME sox - Sound eXchange : universal sound sample translatorSYNOPSIS sox infile1 [ infile2 ... ] outfile sox [ general options ] [ format options ] infile1 [ [ format options ] infile2 ... ] [ format options ] outfile [ effect [ effect options ] ... ] soxmix infile1 infile2 [ infile3 ... ] outfile soxmix [ general options ] [ format options ] infile1 [ format options ] infile2 [ [ format options ] infile3 ... ] [ format options ] outfile [ effect [ effect options ] ... ] General options: [ -h ] [ -p ] [ -V ] Format options: [ -t filetype ] [ -r rate ] [ -s/-u/-U/-A/-a/-i/-g/-f ] [ -b/-w/-l/-d ] [ -v volume ] [ -c channels ] [ -x ] [ -e ] Effects: avg [ -l | -r | -f | -b | -1 | -2 | -3 | -4 | n,n,...,n ] band [ -n ] center [ width ] bandpass frequency bandwidth bandreject frequency bandwidth chorus gain-in gain out delay decay speed depth -s | -t [ delay decay speed depth -s | -t ] compand attack1,decay1[,attack2,decay2...] in-dB1,out-dB1[,in-dB2,out-dB2...] [ gain [ initial-volume [ delay ] ] ] copy dcshift shift [ limitergain ] deemph earwax echo gain-in gain-out delay decay [ delay decay ... ] echos gain-in gain-out delay decay [ delay decay ... ] fade [ type ] fade-in-length [ stop-time [ fade-out-length ] ] filter [ low ]-[ high ] [ window-len [ beta ]] flanger gain-in gain-out delay decay speed < -s | -t > highp frequency highpass frequency lowp frequency lowpass frequency mask mcompand "attack1,decay1[,attack2,decay2...] in-dB1,out-dB1[,in-dB2,out-dB2...] [ gain [ initial-volume [ delay ] ] ]" xover_freq noiseprof [profile-file] noisered profile-file [threshold] pan direction phaser gain-in gain-out delay decay speed < -s | -t > pick [ -1 | -2 | -3 | -4 | -l | -r | -f | -b ] pitch shift [ width interpole fade ] polyphase [ -w < nut / ham > ] [ -width < long / short / # > ] [ -cutoff # ] rate repeat count resample [ -qs | -q | -ql ] [ rolloff [ beta ] ] reverb gain-out reverb-time delay [ delay ... ] reverse silence above_periods [ duration threshold[ d | % ] [ below_periods duration threshold[ d | % ]] speed [ -c ] factor stat [ -s n ] [ -rms ] [ -v ] [ -d ] stretch [ factor [ window fade shift fading ] swap [ 1 2 | 1 2 3 4 ] synth [ length ] type mix [ freq [ -freq2 ] [ off ] [ ph ] [ p1 ] [ p2 ] [ p3 ] trim start [ length ] vibro speed [ depth ] vol gain [ type [ limitergain ] ]DESCRIPTION SoX is a command line program that can convert most popular audio files to most other popular audio file formats. It can optionally change the audio sample data type and apply one or more sound effects to the file during this translation. If more then one input file is specified then they are concatenated into the output file. In this case, it has a restriction that all input files must be of the same data type and sample rates. soxmix is functionally the same as the command line program sox expect that it takes two or more files as input and mixes the audio together to produce a single file as output. It has a restriction that all input files must be of the same data type and sample rates. There are two types of audio file formats that SoX can work with. The first are self-describing file formats. These contain a header that completely describe the characteristics of the audio data that follows. The second type are header-less data, or sometimes called raw data. A user must pass enough information to SoX on the command line so that it knows what type of data it contains. Audio data can usually be totally described by four characteristics: rate The sample rate is in samples per second. For example, CD sample rates are at 44100. data size The precision the data is stored in. Most popular are 8-bit bytes or 16-bit words. data encoding What encoding the data type uses. Examples are u-law, ADPCM, or signed linear data. channels How many channels are contained in the audio data. Mono and Stereo are the two most common. Please refer to the soxexam(1) manual page for a long description with examples on how to use SoX with various types of file formats.OPTIONS The option syntax is a little grotty, but in essence: sox file.au file.wav translates a sound file in SUN Sparc .AU format into a Microsoft .WAV file, while sox -v 0.5 file.au -r 12000 file.wav mask does the same format translation but also lowers the amplitude by 1/2, changes the sampling rate to 12000 hertz, and applies the mask sound effect to the audio data. The following will mix two sound files together to to produce a single sound file. soxmix music.wav voice.wav mixed.wav Format options: Format options effect the audio samples that they immediately precede. If they are placed before the input file name then they effect the input data. If they are placed before the output file name then they will effect the output data. By taking advantage of this, you can override a input file’s corrupted header or produce an output file that is totally different style then the input file. It is also how SoX is informed about the format of raw input data. -t filetype gives the type of the sound sample file. Useful when file extension is not standard or for specifying the .auto file type. -r rate Gives the sample rate in Hertz of the file. To cause the output file to have a different sample rate than the input file, include this option as a part of the output options. If the input and output files have different rates then a sample rate change effect must be ran. If a sample rate changing effect is not specified then a default one will internally be ran by SoX using its default parameters. -v volume Change amplitude (floating point); less than 1.0 decreases, greater than 1.0 increases. May use a negative number to invert the phase of the audio data. It is interesting to note that we perceive volume logarithmically but this adjusts the amplitude linearly. As with other format options, the volume option effects the file its specified with. This is useful whe processing muti- ple input files as the volume adjustment can be specified for each input file or just once to adjust the output file. This can be compared to an audio mixer were you can control the volume of each input as well as a master volume (output side). soxmix defaults the value of the -v option for each input file to 1/input_file_count. This means if your mixing two input files together then each input file’s volume is adjusted by 0.5. This is done to prevent clipping of audio data during the mixing operation. Users will most likely not be happy with this large of a volume adjustment and can spec- ify the -v option to override this default value. Note: For the non-mixing case, see the stat effect for infor- mation on finding the maximum volume adjustment that can be done with this option without causing audio data to be clipped. -s/-u/-U/-A/-a/-i/-g/-f The sample data encoding is signed linear (2’s complement), unsigned linear, u-law (logarithmic), A-law (logarithmic), ADPCM, IMA_ADPCM, GSM, or Floating-point. U-law (actually shorthand for mu-law) and A-law are the U.S. and international standards for logarithmic telephone sound compression. When uncompressed u-law has roughly the preci- sion of 14-bit PCM audio and A-law has roughly the precision of 13-bit PCM audio. A-law and u-law data is sometimes encoded using a reversed bit-ordering (ie. MSB becomes LSB). Internally, SoX under- stands how to work with this encoding but there is currently no command line option to specify it. If you need this sup- port then you can use the psuedo file types of ".la" and ".lu" to inform sox of the encoding. See supported file types for more information. ADPCM is a form of sound compression that has a good compro- mise between good sound quality and fast encoding/decoding time. It is used for telephone sound compression and places were full fidelity is not as important. When uncompressed it has roughly the precision of 16-bit PCM audio. Popular ver- sion of ADPCM include G.726, MS ADPCM, and IMA ADPCM. The -a flag has different meanings in different file handlers. In .wav files it represents MS ADPCM files, in all others it means G.726 ADPCM. IMA ADPCM is a specific form of ADPCM compression, slightly simpler and slightly lower fidelity than Microsoft’s flavor of ADPCM. IMA ADPCM is also called DVI ADPCM. GSM is a standard used for telephone sound compression in European countries and its gaining popularity because of its quality. It usually is CPU intensive to work with GSM audio data. -b/-w/-l/-d The sample data size is in bytes, 16-bit words, 32-bit long words, or 64-bit double long (long long) words. -x The sample data is in XINU format; that is, it comes from a machine with the opposite word order than yours and must be swapped according to the word-size given above. Only 16-bit and 32-bit integer data may be swapped. Machine-format floating-point data is not portable. -c channels The number of sound channels in the data file. This may be 1, 2, or 4; for mono, stereo, or quad sound data. To cause the output file to have a different number of channels than the input file, include this option with the output file options. If the input and output file have a different num- ber of channels then the avg effect must be used. If the avg effect is not specified on the command line it will be invoked internally with default parameters. -e When used after the input filename (so that it applies to the output file) it allows you to avoid giving an output filename and will not produce an output file. It will apply any spec- ified effects to the input file. This is mainly useful with the stat effect but can be used with others. General options: -h Print version number and usage information. -p Run in preview mode and run fast. This will somewhat speed up SoX when the output format has a different number of chan- nels and a different rate than the input file. Currently, this defaults to using the rate effect instead of the resam- ple effect for sample rate changes. -V Print a description of processing phases. Useful for figur- ing out exactly how SoX is mangling your sound samples.FILE TYPES SoX attempts to determine the file type of input files automatically by looking at the header of the audio file. When it is unable to detect the file type or if its an output file then it uses the file extension of the file to determine what type of file format handler to use. This can be overridden by specifying the "-t" option on the command line. The input and output files may be read from standard in and out. This is done by specifying ’-’ as the filename. File formats which have headers are checked, if that header doesn’t seem right, the program exits with an appropriate message. The following file formats are supported: .8svx Amiga 8SVX musical instrument description format. .aiff AIFF files used on Apple IIc/IIgs and SGI. Note: the AIFF format supports only one SSND chunk. It does not support multiple sound chunks, or the 8SVX musical instrument description format. AIFF files are multimedia archives and can have multiple audio and picture chunks. You may need a separate archiver to work with them. .alsa ALSA /dev/snd/pcmCxDxp device driver This is a pseudo-file type and can be optionally compiled
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -