📄 sox.txt
字号:
Translate input sampling rate to output sampling rate via simulated analog filtration. This method is slower than rate, but gives much better results. By default, linear interpolation is used, with a window width about 45 samples at the lower of the two rate. This gives an accuracy of about 16 bits, but insufficient stopband rejec- tion in the case that you want to have rolloff greater than about 0.80 of the Nyquist frequency. The -q* options will change the default values for rolloff and beta as well as use quadratic interpolation of filter coefficients, resulting in about 24 bits precision. The -qs, -q, or -ql options specify increased accuracy at the cost of lower execution speed. It is optional to specify rolloff and beta parameters when using the -q* options. Following is a table of the reasonable defaults which are built-in to SoX: Option Window rolloff beta interpolation ------ ------ ------- ---- ------------- (none) 45 0.80 16 linear -qs 45 0.80 16 quadratic -q 75 0.875 16 quadratic -ql 149 0.94 16 quadratic ------ ------ ------- ---- ------------- -qs, -q, or -ql use window lengths of 45, 75, or 149 samples, respectively, at the lower sample-rate of the two files. This means progressively sharper stop-band rejection, at pro- portionally slower execution times. rolloff refers to the cut-off frequency of the low pass fil- ter and is given in terms of the Nyquist frequency for the lower sample rate. rolloff therefore should be something between 0.0 and 1.0, in practice 0.8-0.95. The defaults are indicated above. The Nyquist frequency is equal to (sample rate / 2). Logi- cally, this is because the A/D converter needs at least 2 samples to detect 1 cycle at the Nyquist frequency. Frequen- cies higher then the Nyquist will actually appear as lower frequencies to the A/D converter and is called aliasing. Normally, A/D converts run the signal through a highpass fil- ter first to avoid these problems. Similar problems will happen in software when reducing the sample rate of an audio file (frequencies above the new Nyquist frequency can be aliased to lower frequencies). Therefore, a good resample effect will remove all frequency information above the new Nyquist frequency. The rolloff refers to how close to the Nyquist frequency this cutoff is, with closer being better. When increasing the sample rate of an audio file you would not expect to have any frequencies exist that are past the original Nyquist fre- quency. Because of resampling properties, it is common to have aliasing data created that is above the old Nyquist fre- quency. In that case the rolloff refers to how close to the original Nyquist frequency to use a highpass filter to remove this false data, with closer also being better. The beta parameter determines the type of filter window used. Any value greater than 2.0 is the beta for a Kaiser window. Beta <= 2.0 selects a Nuttall window. If unspecified, the default is a Kaiser window with beta 16. In the case of Kaiser window (beta > 2.0), lower betas pro- duce a somewhat faster transition from passband to stopband, at the cost of noticeable artifacts. A beta of 16 is the default, beta less than 10 is not recommended. If you want a sharper cutoff, don’t use low beta’s, use a longer sample window. A Nuttall window is selected by specifying any ’beta’ <= 2, and the Nuttall window has somewhat steeper cut- off than the default Kaiser window. You will probably not need to use the beta parameter at all, unless you are just curious about comparing the effects of Nuttall vs. Kaiser windows. This is the default effect if the two files have different sampling rates. Default parameters are, as indicated above, Kaiser window of length 45, rolloff 0.80, beta 16, linear interpolation. NOTE: -qs is only slightly slower, but more accurate for 16-bit or higher precision. NOTE: In many cases of up-sampling, no interpolation is needed, as exact filter coefficients can be computed in a reasonable amount of space. To be precise, this is done when input_rate < output_rate && output_rate/gcd(input_rate,output_rate) <= 511 reverb gain-out reverbe-time delay [ delay ... ] Add reverberation to a sound sample. Each delay is given in milliseconds and its feedback is depending on the reverb-time in milliseconds. Each delay should be in the range of half to quarter of reverb-time to get a realistic reverberation. Gain-out is the volume of the output. reverse Reverse the sound sample completely. Included for finding Satanic subliminals. silence above_periods [ duration threshold[ d | % ] [ below_periods duration threshold[ d | % ]] Removes silence from the beginning or end of a sound file. Silence is anything below a specified threshold. When trimming silence from the beginning of a sound file, you specify a duration of audio that is above a given silence threshold before audio data is processed. You can also spec- ify the count of periods of none-silence you want to detect before processing audio data. Specify a period of 0 if you do not want to trim data from the front of the sound file. When optionally trimming silence form the end of a sound file, you specify the duration of audio that must be below a given threshold before stopping to process audio data. A count of periods that occur below the threshold may also be specified. If this options are not specified then data is not trimmed from the end of the audio file. If below_periods is negative, it is treated as a positive value and is also used to indicate the effect should restart processing as specified by the above_periods, making it suitable for remov- ing periods of silence in the middle of a sound file. Duration counts may be in the format of time, hh:mm:ss.frac, or in the exact count of samples. Threshold may be suffixed with d, or % to indicated the value is in decibels or a percentage of max value of the sample value. A value of ’0%’ will look for total silence. speed [ -c ] factor Speed up or down the sound, as a magnetic tape with a speed control. It affects both pitch and time. A factor of 1.0 means no change, and is the default. 2.0 doubles speed, thus time length is cut by a half and pitch is one octave higher. 0.5 halves speed thus time length doubles and pitch is one octave lower. If the optional -c parameter is used then the factor is specified in "cents". stat [ -s n ] [-rms ] [ -v ] [ -d ] Do a statistical check on the input file, and print results on the standard error file. Audio data is passed unmodified from input to output file unless used along with the -e option. The "Volume Adjustment:" field in the statistics gives you the argument to the -v number which will make the sample as loud as possible without clipping. The option -v will print out the "Volume Adjustment:" field’s value only and return. This could be of use in scripts to auto convert the volume. The -s n option is used to scale the input data by a given factor. The default value of n is the max value of a signed long variable (0x7fffffff). Internal effects always work with signed long PCM data and so the value should relate to this fact. The -rms option will convert all output average values to root mean square format. There is also an optional parameter -d that will print out a hex dump of the sound file from the internal buffer that is in 32-bit signed PCM data. This is mainly only of use in tracking down endian problems that creep in to SoX on cross- platform versions. stretch factor [window fade shift fading] Time stretch file by a given factor. Change duration without affecting the pitch. factor of stretching: >1.0 lengthen, <1.0 shorten duration. window size is in ms. Default is 20ms. The fade option, can be "lin". shift ratio, in [0.0 1.0]. Default depends on stretch factor. 1.0 to shorten, 0.8 to lengthen. The fading ratio, in [0.0 0.5]. The amount of a fade’s default depends on factor and shift. swap [ 1 2 | 1 2 3 4 ] Swap channels in multi-channel sound files. Optionally, you may specify the channel order you would like the output in. This defaults to output channel 2 and then 1 for stereo and 2, 1, 4, 3 for quad-channels. An interesting feature is that you may duplicate a given channel by overwriting another. This is done by repeating an output channel on the command line. For example, swap 2 2 will overwrite channel 1 with channel 2’s data; creating a stereo file with both channels containing the same audio data. synth [ length ] type mix [ freq [ -freq2 ] [ off ] [ ph ] [ p1 ] [ p2 ] [ p3 ] The synth effect will generate various types of audio data. Although this effect is used to generate audio data, an input file must be specified. The length of the input audio file determines the length of the output audio file. <length> length in sec or hh:mm:ss.frac, 0=inputlength, default=0 <type> is sine, square, triangle, sawtooth, trapetz, exp, whitenoise, pinknoise, brownnoise, default=sine <mix> is create, mix, amod, default=create <freq> frequency at beginning in Hz, not used for noise.. <freq2> frequency at end in Hz, not used for noise.. <freq/2> can be given as %%n, where ’n’ is the number of half notes in respect to A (440Hz) <off> Bias (DC-offset) of signal in percent, default=0 <ph> phase shift 0..100 shift phase 0..2*Pi, not used for noise.. <p1> square: Ton/Toff, triangle+trapetz: rising slope time (0..100) <p2> trapetz: ON time (0..100) <p3> trapetz: falling slope position (0..100) trim start [ length ] Trim can trim off unwanted audio data from the beginning and end of the audio file. Audio samples are not sent to the output stream until the start location is reached. The optional length parameter tells the number of samples to output after the start sample and is used to trim off the back side of the audio data. Using a value of 0 for the start parameter will allow trimming off the back side only. Both options can be specified using either an amount of time and an exact count of samples. The format for specifying lengths in time is hh:mm:ss.frac. A start value of 1:30.5 will not start until 1 minute, thirty and 1/2 seconds into the audio data. The format for specifying sample counts is the number of samples with the letter ’s’ appended to it. A value of 8000s will wait until 8000 samples are read before starting to process audio data. vibro speed [ depth ] Add the world-famous Fender Vibro-Champ sound effect to a sound sample by using a sine wave as the volume knob. Speed gives the Hertz value of the wave. This must be under 30. Depth gives the amount the volume is cut into by the sine wave, ranging 0.0 to 1.0 and defaulting to 0.5. vol gain [ type [ limitergain ] ] The vol effect is much like the command line option -v. It allows you to adjust the volume of an input file and allows you to specify the adjustment in relation to amplitude, power, or dB. If type is not specified then it defaults to amplitude. When type is amplitude then a linear change of the amplitude is performed based on the gain. Therefore, a value of 1.0 will keep the volume the same, 0.0 to < 1.0 will cause the volume to decrease and values of > 1.0 will cause the volume to increase. Beware of clipping audio data when the gain is greater then 1.0. A negative value performs the same adjust- ment while also changing the phase. When type is power then a value of 1.0 also means no change in volume. When type is dB the amplitude is changed logarithmically. 0.0 is constant while +6 doubles the amplitude. An optional limitergain value can be specified and should be a value much less then 1.0 (ie 0.05 or 0.02) and is used only on peaks to prevent clipping. Not specifying this parameter will cause no limiter to be used. In verbose mode, this effect will display the percentage of audio data that needed to be limited.BUGS The syntax is horrific. Thats the breaks when trying to handle all things from the command line. Please report any bugs found in this version of SoX to Chris Bagwell (cbagwell@users.sourceforge.net)FILESSEE ALSO play(1), rec(1), soxexam(1)NOTICES The version of SoX that accompanies this manual page is support by Chris Bagwell (cbagwell@users.sourceforge.net). Please refer any ques- tions regarding it to this address. You may obtain the latest version at the the web site http://sox.sourceforge.net/AUTHOR Chris Bagwell (cbagwell@users.sourceforge.net). Updates by Anonymous December 11, 2001 SoX(1)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -