SSSSOOOOXXXX((((1111)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV SSSSOOOOXXXX((((1111)))) NNNNAAAAMMMMEEEE sox - SOund eXchange - universal sound sample translator SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS ssssooooxxxx _i_n_f_i_l_e _o_u_t_f_i_l_e ssssooooxxxx _i_n_f_i_l_e _o_u_t_f_i_l_e [[[[ _e_f_f_e_c_t [[[[ _e_f_f_e_c_t _o_p_t_i_o_n_s ... ]]]] ]]]] ssssooooxxxx _i_n_f_i_l_e ----eeee _e_f_f_e_c_t [[[[ _e_f_f_e_c_t _o_p_t_i_o_n_s ... ]]]] ssssooooxxxx [ _g_e_n_e_r_a_l _o_p_t_i_o_n_s ]]]] [[[[ _f_o_r_m_a_t _o_p_t_i_o_n_s ]]]] _i_f_i_l_e [[[[ _f_o_r_m_a_t _o_p_t_i_o_n_s ]]]] _o_f_i_l_e [[[[ _e_f_f_e_c_t [ _e_f_f_e_c_t _o_p_t_i_o_n_s ... ]]]] ]]]] _G_e_n_e_r_a_l _o_p_t_i_o_n_s: [[[[ ----hhhh ]]]] [[[[ ----VVVV ]]]] [[[[ ----vvvv _v_o_l_u_m_e ]]]] _F_o_r_m_a_t _o_p_t_i_o_n_s: [[[[ ----tttt _f_i_l_e_t_y_p_e ]]]] [[[[ ----rrrr _r_a_t_e ]]]] [[[[ ----ssss////----uuuu////----UUUU////----AAAA ]]]] [[[[ ----bbbb////----wwww////----llll////----ffff////----dddd////----DDDD ]]]] [[[[ ----cccc _c_h_a_n_n_e_l_s ]]]] [[[[ ----xxxx ]]]] _E_f_f_e_c_t_s: ccccooooppppyyyy rrrraaaatttteeee aaaavvvvgggg [[[[ -_l |||| -_r ]]]] rrrreeeessssaaaammmmpppplllleeee mmmmaaaasssskkkk ssssttttaaaatttt eeeecccchhhhoooo _d_e_l_a_y _v_o_l_u_m_e [[[[ _d_e_l_a_y _v_o_l_u_m_e ... ]]]] vvvviiiibbbbrrrroooo _s_p_e_e_d [[[[ _d_e_p_t_h ]]]] lllloooowwwwpppp _c_e_n_t_e_r hhhhiiiigggghhhhpppp _c_e_n_t_e_r bbbbaaaannnndddd [[[[ -_n ]]]] _c_e_n_t_e_r [[[[ _w_i_d_t_h ]]]] DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN _S_o_x translates sound files from one format to another, possibly doing a sound effect. OOOOPPPPTTTTIIIIOOOONNNNSSSS The option syntax is a little grotty, but in essence: sox file.au file.voc translates a sound sample in SUN Sparc .AU format into a SoundBlaster .VOC file, while sox -v 0.5 file.au -rate 12000 file.voc rate does the same format translation but also lowers the amplitude by 1/2 and changes the sampling rate from 8000 hertz to 12000 hertz via the rrrraaaatttteeee _s_o_u_n_d _e_f_f_e_c_t loop. File type options: ----tttt _f_i_l_e_t_y_p_e gives the type of the sound sample file. ----rrrr _r_a_t_e Give sample rate in Hertz of file. ----ssss////----uuuu////----UUUU////----AAAA The sample data is signed linear (2's complement), unsigned linear, U-law (logarithmic), or A-law (logarithmic). U-law and A-law are the U.S. and international standards for logarithmic telephone sound compression. Page 1 (printed 8/12/94) SSSSOOOOXXXX((((1111)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV SSSSOOOOXXXX((((1111)))) ----bbbb////----wwww////----llll////----ffff////----dddd////----DDDD The sample data is in bytes, 16-bit words, 32-bit longwords, 32-bit floats, 64-bit double floats, or 80-bit IEEE floats. Floats and double floats are in native machine format. ----xxxx 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. IEEE floats are a fixed, portable format. ??? ----cccc _c_h_a_n_n_e_l_s The number of sound channels in the data file. This may be 1, 2, or 4; for mono, stereo, or quad sound data. General options: ----eeee after the input file allows you to avoid giving an output file and just name an effect. This is only useful with the ssssttttaaaatttt effect. ----vvvv _v_o_l_u_m_e Change amplitude (floating point); less than 1.0 decreases, greater than 1.0 increases. Note: we perceive volume logarithmically, not linearly. Note: see the ssssttttaaaatttt effect. ----hhhh Print version number and usage information. ----VVVV Print a description of processing phases. Useful for figuring out exactly how _s_o_x is mangling your sound samples. The input and output files may be standard input and output. This is specified by '-'. The ----tttt _t_y_p_e option must be given in this case, else _s_o_x will not know the format of the given file. The ----tttt,,,, ----rrrr,,,, ----ssss////----uuuu////----UUUU////----AAAA,,,, ----bbbb////----wwww////----llll////----ffff////----dddd////----DDDD and ----xxxx options refer to the input data when given before the input file name. After, they refer to the output data. If you don't give an output file name, _s_o_x will just read the input file. This is useful for validating structured file formats; the ssssttttaaaatttt effect may also be used via the ----eeee option. FFFFIIIILLLLEEEE TTTTYYYYPPPPEEEESSSS _S_o_x needs to know the formats of the input and output files. File formats which have headers are checked, if that header doesn't seem right, the program exits with an appropriate Page 2 (printed 8/12/94) SSSSOOOOXXXX((((1111)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV SSSSOOOOXXXX((((1111)))) message. Currently, raw (no header) binary and textual data, IRCAM Sound Files, Sound Blaster, SPARC .AU (w/header), Mac HCOM, PC/DOS .SOU, Sndtool, and Sounder, NeXT .SND, Windows 3.0 RIFF/WAV, Turtle Beach .SMP, CD-R, and Apple/SGI AIFF and 8SVX formats are supported. ....aaaaiiiiffffffff 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 and can have multiple audio and picture chunks. You may need a separate archiver to work with them. ....aaaauuuu SUN Microsystems AU files. There are apparently many types of .au files; DEC has invented its own with a different magic number and word order. The .au handler can read these files but will not write them. Some .au files have valid AU headers and some do not. The latter are probably original SUN u-law 8000 hz samples. These can be dealt with using the ....uuuullll format (see below). ....hhhhccccoooommmm Macintosh HCOM files. These are (apparently) Mac FSSD files with some variant of Huffman compression. The Macintosh has wacky file formats and this format handler apparently doesn't handle all the ones it should. Mac users will need your usual arsenal of file converters to deal with an HCOM file under Unix or DOS. ....rrrraaaawwww Raw files (no header). The sample rate, size (byte, word, etc), and style (signed, unsigned, etc.) of the sample file must be given. The number of channels defaults to 1. ....uuuubbbb,,,, ....ssssbbbb,,,, ....uuuuwwww,,,, ....sssswwww,,,, ....uuuullll These are several suffices which serve as a shorthand for raw files with a given size and style. Thus, uuuubbbb,,,, ssssbbbb,,,, uuuuwwww,,,, sssswwww,,,, and uuuullll correspond to "unsigned byte", "signed byte", "unsigned word", "signed word", and "ulaw" (byte). The sample rate defaults to 8000 hz if not explicitly set, and the number of channels (as always) defaults to 1. There are lots of Sparc samples floating around in u-law format with no header and fixed at a sample rate of 8000 hz. (Certain sound management software cheerfully ignores the headers.) Similarly, most Mac sound files are in unsigned byte format with a sample rate of 11025 or 22050 hz. Page 3 (printed 8/12/94) SSSSOOOOXXXX((((1111)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV SSSSOOOOXXXX((((1111)))) ....ssssffff IRCAM Sound Files. SoundFiles are used by academic music software such as the CSound package, and the MixView sound sample editor. ....vvvvoooocccc Sound Blaster VOC files. VOC files are multi-part and contain silence parts, looping, and different sample rates for different chunks. On input, the silence parts are filled out, loops are rejected, and sample data with a new sample rate is rejected. Silence with a different sample rate is generated appropriately. On output, silence is not detected, nor are impossible sample rates. ....aaaauuuuttttoooo This is a ``meta-type'': specifying this type for an input file triggers some code that tries to guess the real type by looking for magic words in the header. If the type can't be guessed, the program exits with an error message. The input must be a plain file, not a pipe. This type can't be used for output files. ....ccccddddrrrr CD-R CD-R files are used in mastering music Compact Disks. The file format is, as you might expect, raw stereo raw unsigned samples at 44khz. But, there's some blocking/padding oddity in the format, so it needs its own handler. ....ddddaaaatttt Text Data files These files contain a textual representation of the sample data. There is one line at the beginning that contains the sample rate. Subsequent lines contain two numeric data items: the time since the beginning of the sample and the sample value. Values are normalized so that the maximum and minimum are 1.00 and -1.00. This file format can be used to create data files for external programs such as FFT analyzers or graph routines. SOX can also convert a file in this format back into one of the other file formats. ....ssssmmmmpppp Turtle Beach SampleVision files. SMP files are for use with the PC-DOS package SampleVision by Turtle Beach Softworks. This package is for communication to several MIDI samplers. All sample rates are supported by the package, although not all are supported by the samplers themselves. Currently loop points are ignored. Page 4 (printed 8/12/94) SSSSOOOOXXXX((((1111)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV SSSSOOOOXXXX((((1111)))) ....wwwwaaaavvvv Windows 3.0 .WAV RIFF files. These appear to be very similar to IFF files, but not the same. They are the native sound file format of Windows 3.0. (Obviously, Windows 3.0 was of such incredible importance to the computer industry that it just had to have its own sound file format.) Normally ....wwwwaaaavvvv files have all formatting information in their headers, and so do not need any format options specified for an input file. If any are, they will overide the file header, and you will be warned to this effect. You had better know what you are doing! Output format options will cause a format conversion, and the ....wwwwaaaavvvv will written appropriately. Note that it is possible to write data of a type that cannot be specified by the ....wwwwaaaavvvv header, and you will be warned that you a writing a bad file ! ....mmmmaaaauuuudddd An Amiga format An IFF-conform sound file type, registered by MS MacroSystem Computer GmbH, published along with the "Toccata" sound-card on the Amiga. Allows 8bit linear, 16bit linear, A-Law, u-law in mono and stereo. ....vvvvwwwweeee Psion 8-bit alaw These are 8-bit a-law 8khz sound files used on the Psion palmtop portable computer. EEEEFFFFFFFFEEEECCCCTTTTSSSS Only one effect from the palette may be applied to a sound sample. To do multiple effects you'll need to run _s_o_x in a pipeline. copy Copy the input file to the output file. This is the default effect if both files have the same sampling rate, or the rates are "close". rate Translate input sampling rate to output sampling rate via linear interpolation to the Least Common Multiple of the two sampling rates. This is the default effect if the two files have different sampling rates. This is fast but noisy: the spectrum of the original sound will be shifted upwards and duplicated faintly when up-translating by a Page 5 (printed 8/12/94) SSSSOOOOXXXX((((1111)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV SSSSOOOOXXXX((((1111)))) multiple. Lerp-ing is acceptable for cheap 8-bit sound hardware, but for CD- quality sound you should instead use: resample [ _r_o_l_l_o_f_f [ _b_e_t_a ] ] Translate input sampling rate to output sampling rate via simulated analog filtration. This method is slow and uses lots of RAM, but gives much better results then rrrraaaatttteeee.... mask Add "masking noise" to signal. This effect deliberately adds white noise to a sound in order to mask quantization effects, created by the process of playing a sound digitally. It tends to mask buzzing voices, for example. It adds 1/2 bit of noise to the sound file at the output bit depth. avg [ -_l | -_r ] Reduce the number of channels by averaging the samples, or duplicate channels to increase the number of channels. Valid combinations are 1 - 2, 1 - 4, 2 - 4, 4 - 2, 4 - 1, 2 - 1. The -_l or -_r option averages from just left or right channels/duplicates to just the left or right channels. stat Do a statistical check on the input file, and print results on the standard error file. ssssttttaaaatttt may copy the file untouched from input to output, if you select an output file. The "Volume Adjustment:" field in the statistics gives you the argument to the ----vvvv _n_u_m_b_e_r which will make the sample as loud as possible. echo [ _d_e_l_a_y _v_o_l_u_m_e ... ]]]] Add echoing to a sound sample. Each delay/volume pair gives the delay in seconds and the Page 6 (printed 8/12/94) SSSSOOOOXXXX((((1111)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV SSSSOOOOXXXX((((1111)))) volume (relative to 1.0) of that echo. If the volumes add up to more than 1.0, the sound will melt down instead of fading away. vibro _s_p_e_e_d [[[[ _d_e_p_t_h ]]]] Add the world-famous Fender Vibro-Champ sound effect to a sound sample by using a sine wave as the volume knob. SSSSppppeeeeeeeedddd gives the Hertz value of the wave. This must be under 30. DDDDeeeepppptttthhhh gives the amount the volume is cut into by the sine wave, ranging 0.0 to 1.0 and defaulting to 0.5. lowp _c_e_n_t_e_r Apply a low-pass filter. The frequency response drops logarithmically with _c_e_n_t_e_r frequency in the middle of the drop. The slope of the filter is quite gentle. highp _c_e_n_t_e_r Apply a high-pass filter. The frequency response drops logarithmically with _c_e_n_t_e_r frequency in the middle of the drop. The slope of the filter is quite gentle. band [[[[ -_n ]]]] _c_e_n_t_e_r [[[[ _w_i_d_t_h ]]]] Apply a band-pass filter. The frequency response drops logarithmically around the _c_e_n_t_e_r frequency. The _w_i_d_t_h gives the slope of the drop. The frequencies at _c_e_n_t_e_r + _w_i_d_t_h and _c_e_n_t_e_r - _w_i_d_t_h will be half of their original amplitudes. BBBBaaaannnndddd defaults to a mode oriented to pitched signals, i.e. voice, singing, or instrumental music. The -_n (for noise) option uses the alternate mode for un-pitched signals. BBBBaaaannnndddd introduces noise in the shape of the filter, i.e. peaking at the _c_e_n_t_e_r frequency and settling around it. cut _l_o_o_p_n_u_m_b_e_r Extract loop #N from a sample. Page 7 (printed 8/12/94) SSSSOOOOXXXX((((1111)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV SSSSOOOOXXXX((((1111)))) map Display a list of loops in a sample, and miscellaneous loop info. pick Select the left or right channel of a stereo sample, or one of four channels in a quadrophonic sample. split Turn a mono sample into a stereo sample. It does no handy things like volume pan, phase pan, or binaural or 3D sound. _S_o_x enforces certain effects. If the two files have different sampling rates, the requested effect must be one of ccccooooppppyyyy,,,, or rrrraaaatttteeee,,,, If the two files have different numbers of channels, the aaaavvvvgggg effect must be requested. reverse Reverse the sound sample completely. Included for finding Satanic subliminals. BBBBUUUUGGGGSSSS The syntax is horrific. It's very tempting to include a default system that allows an effect name as the program name and just pipes a sound sample from standard input to standard output, but the problem of inputting the sample rates makes this unworkable. FFFFIIIILLLLEEEESSSS SSSSEEEEEEEE AAAALLLLSSSSOOOO NNNNOOOOTTTTIIIICCCCEEEESSSS The echoplex effect is: Copyright (C) 1989 by Jef Poskanzer. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. This software is provided "as is" without express or implied warranty. Page 8 (printed 8/12/94)