Unified · Split
| @@ -49,6 +49,8 @@ sox-12.17.6 · 48 unmodified lines | ||
| 49 | 49 | o Added patch from Eric Benson that attempts to do a seek() |
| 50 | 50 | if the first effect is trim. This greatly speeds up |
| 51 | 51 | processing large files. |
| 52 | + o Daniel Pouzzner implemented a multi-band compander (using | |
| 53 | + the butterworth filters to split the audio into bands). | |
| 52 | 54 | |
| 53 | 55 | sox-12.17.5 |
| 54 | 56 | ----------- |
| @@ -0,0 +1,18 @@ | ||
| 1 | +#!/bin/sh | |
| 2 | +# | |
| 3 | +# fmsim - simulates FM radio sound (or broadcast signal condition if the | |
| 4 | +# lowp at the end is skipped - not that the pipeline is set up with | |
| 5 | +# US-style 75us preemphasis). | |
| 6 | +# | |
| 7 | +# Thats signed 32-bit 44100Hz audio from stdin and outputs to stdout. | |
| 8 | + | |
| 9 | + | |
| 10 | +../src/sox -V -t raw -r 44100 -s -w -c 2 - -t raw -r 44100 -s -l -c 2 \ | |
| 11 | + - vol -3 db filter 8000- 32 100 mcompand ".005,.1 \ | |
| 12 | + -47,-40,-34,-34,-17,-33 0 0 0" 100 ".003,.05 \ | |
| 13 | + -47,-40,-34,-34,-17,-33 0 0 0" 400 ".000625,.0125 \ | |
| 14 | + -47,-40,-34,-34,-15,-33 0 0 0" 1600 ".0001,.025 \ | |
| 15 | + -47,-40,-34,-34,-31,-31,-0,-30 0 0 0" 6400 \ | |
| 16 | + "0,.025 -38,-31,-28,-28,-0,-25 0 0 0" vol 27 db vol -12 \ | |
| 17 | + db highpass 22 highpass 22 filter -17500 256 vol +12 db \ | |
| 18 | + vol -3 db lowp 17801 | |
| @@ -93,6 +93,12 @@ sox \- Sound eXchange : universal sound sample translator · 92 unmodified lines | ||
| 93 | 93 | \fBlowpass\fR \fIfrequency\fR |
| 94 | 94 | .br |
| 95 | 95 | \fBmask\fR |
| 96 | +.br | |
| 97 | + \fBmcompand\fR "\fIattack1\fR,\fIdecay1\fR[,\fIattack2\fR,\fIdecay2\fR...] | |
| 98 | +.br | |
| 99 | + \fIin-dB1\fR,\fIout-dB1\fR[,\fIin-dB2\fR,\fIout-dB2\fR...] | |
| 100 | +.br | |
| 101 | + [ \fIgain\fR [ \fIinitial-volume\fR [ \fIdelay\fR ] ] ]" xover_freq | |
| 96 | 102 | .br |
| 97 | 103 | \fBpan\fR \fIdirection\fR |
| 98 | 104 | .br |
| @@ -907,6 +913,16 @@ created by the process of playing a sound digitally. · 808 unmodified lines | ||
| 907 | 913 | It tends to mask buzzing voices, for example. |
| 908 | 914 | It adds 1/2 bit of noise to the sound file at the |
| 909 | 915 | output bit depth. |
| 916 | +.TP | |
| 917 | +mcompand "\fIattack1,decay1\fR[,\fIattack2,decay2\fR...] | |
| 918 | +.TP | |
| 919 | + \fIin-dB1,out-dB1\fR[,\fIin-dB2,out-dB2\fR...] | |
| 920 | +.TP 10 | |
| 921 | + [\fIgain\fR [\fIinitial-volume\fR [\fIdelay\fR ] ] ]" \fIxover_freq\fR | |
| 922 | + | |
| 923 | +Multi-band compander is similar to the single band compander but | |
| 924 | +the audio file is first divided up into bands and then the compander | |
| 925 | +is ran on each band. See the \fBcompand\fR effect for definition of its options. Compand options are specified between double quotes and the crossover frequency for that band is specefied seperately with \fIxover_fre\fR. This can be repeated multiple times to create multiple bands. | |
| 910 | 926 | .TP 10 |
| 911 | 927 | pan \fIdirection\fB |
| 912 | 928 | Pan the sound of an audio file from one channel to another. This is done by |
| @@ -54,6 +54,9 @@ SYNOPSIS · 53 unmodified lines | ||
| 54 | 54 | lowp frequency |
| 55 | 55 | lowpass frequency |
| 56 | 56 | mask |
| 57 | + mcompand "attack1,decay1[,attack2,decay2...] | |
| 58 | + in-dB1,out-dB1[,in-dB2,out-dB2...] | |
| 59 | + [ gain [ initial-volume [ delay ] ] ]" xover_freq | |
| 57 | 60 | pan direction |
| 58 | 61 | phaser gain-in gain-out delay decay speed < -s | -t > |
| 59 | 62 | pick [ -1 | -2 | -3 | -4 | -l | -r | -f | -b ] |
| @@ -192,9 +195,9 @@ OPTIONS · 132 unmodified lines | ||
| 192 | 195 | ADPCM, IMA_ADPCM, GSM, or Floating-point. |
| 193 | 196 | U-law (actually shorthand for mu-law) and A-law are the U.S. |
| 194 | 197 | and international standards for logarithmic telephone sound |
| 195 | − compression. When uncompressed u-law has roughly the preci- | |
| 196 | − sion of 14-bit PCM audio and A-law has roughly the precision | |
| 197 | − of 13-bit PCM audio. | |
| 198 | + compression. When uncompressed u-law has roughly the | |
| 199 | + precision of 14-bit PCM audio and A-law has roughly the pre- | |
| 200 | + cision of 13-bit PCM audio. | |
| 198 | 201 | A-law and u-law data is sometimes encoded using a reversed |
| 199 | 202 | bit-ordering (ie. MSB becomes LSB). Internally, SoX under- |
| 200 | 203 | stands how to work with this encoding but there is currently |
| @@ -605,11 +608,11 @@ EFFECTS · 404 unmodified lines | ||
| 605 | 608 | the fourth (optional) parameter is an initial volume to be |
| 606 | 609 | assumed for each channel when the effect starts. This per- |
| 607 | 610 | mits the user to supply a nominal level initially, so that, |
| 608 | − for example, a very large gain is not applied to initial sig- | |
| 609 | − nal levels before the companding action has begun to operate: | |
| 610 | − it is quite probable that in such an event, the output would | |
| 611 | − be severely clipped while the compander gain properly adjusts | |
| 612 | − itself. | |
| 611 | + for example, a very large gain is not applied to initial | |
| 612 | + signal levels before the companding action has begun to oper- | |
| 613 | + ate: it is quite probable that in such an event, the output | |
| 614 | + would be severely clipped while the compander gain properly | |
| 615 | + adjusts itself. | |
| 613 | 616 | |
| 614 | 617 | The fifth (optional) parameter is a delay in seconds. The |
| 615 | 618 | input signal is analyzed immediately to control the compan- |
| @@ -674,9 +677,9 @@ EFFECTS · 58 unmodified lines | ||
| 674 | 677 | stop-time is not specified. |
| 675 | 678 | All times can be specified in either periods of time or sam- |
| 676 | 679 | ple counts. To specify time periods use the format |
| 677 | − hh:mm:ss.frac format. To specify using sample counts, spec- | |
| 678 | − ify the number of samples and append the letter ’s’ to the | |
| 679 | − sample count (for example 8000s). | |
| 680 | + hh:mm:ss.frac format. To specify using sample counts, | |
| 681 | + specify the number of samples and append the letter ’s’ to | |
| 682 | + the sample count (for example 8000s). | |
| 680 | 683 | An optional type can be specified to change the type of enve- |
| 681 | 684 | lope. Choices are q for quarter of a sinewave, h for half a |
| 682 | 685 | sinewave, t for linear slope, l for logarithmic, and p for |
| @@ -734,6 +737,20 @@ EFFECTS · 51 unmodified lines | ||
| 734 | 737 | tends to mask buzzing voices, for example. It adds 1/2 bit |
| 735 | 738 | of noise to the sound file at the output bit depth. |
| 736 | 739 | |
| 740 | + mcompand "attack1,decay1[,attack2,decay2...] | |
| 741 | + | |
| 742 | + in-dB1,out-dB1[,in-dB2,out-dB2...] | |
| 743 | + | |
| 744 | + [gain [initial-volume [delay ] ] ]" xover_freq | |
| 745 | + | |
| 746 | + Multi-band compander is similar to the single band compander | |
| 747 | + but the audio file is first divided up into bands and then | |
| 748 | + the compander is ran on each band. See the compand effect | |
| 749 | + for definition of its options. Compand options are specified | |
| 750 | + between double quotes and the crossover frequency for that | |
| 751 | + band is specefied seperately with xover_fre. This can be | |
| 752 | + repeated multiple times to create multiple bands. | |
| 753 | + | |
| 737 | 754 | pan direction |
| 738 | 755 | Pan the sound of an audio file from one channel to another. |
| 739 | 756 | This is done by changing the volume of the input channels so |
| @@ -22,7 +22,7 @@ FOBJ = 8svx.obj adpcm.obj aiff.obj alsa.obj au.obj auto.obj \ · 21 unmodified lines | ||
| 22 | 22 | EOBJ = avg.obj band.obj bandpass.obj breject.obj btrworth.obj chorus.obj \ |
| 23 | 23 | compand.obj copy.obj dcshift.obj deemphas.obj earwax.o \ |
| 24 | 24 | echo.obj echos.obj fade.obj filter.obj flanger.obj highp.obj \ |
| 25 | − highpass.obj lowp.obj lowpass.obj mask.obj phaser.obj \ | |
| 25 | + highpass.obj lowp.obj lowpass.obj mask.obj mcompand.obj phaser.obj \ | |
| 26 | 26 | pitch.obj pan.obj polyphase.obj rate.obj repeat.obj resample.obj \ |
| 27 | 27 | reverb.obj reverse.obj silence.obj speed.obj stat.obj \ |
| 28 | 28 | stretch.obj swap.obj synth.obj trim.obj vibro.obj vol.obj |
| @@ -28,8 +28,8 @@ FOBJ = 8svx.o adpcm.o aiff.o alsa.o au.o auto.o avr.o cdr.o cvsd.o dat.o \ · 27 unmodified lines | ||
| 28 | 28 | EOBJ = avg.o band.o bandpass.o breject.o btrworth.o chorus.o compand.o \ |
| 29 | 29 | copy.o dcshift.o deemphas.o earwax.o echo.o echos.o fade.o \ |
| 30 | 30 | filter.o flanger.o highp.o highpass.o lowp.o lowpass.o \ |
| 31 | − mask.o pan.o phaser.o pitch.o polyphas.o rate.o repeat.o \ | |
| 32 | − resample.o reverb.o reverse.o silence.o speed.o \ | |
| 31 | + mask.o mcompand.o pan.o phaser.o pitch.o polyphas.o rate.o \ | |
| 32 | + repeat.o resample.o reverb.o reverse.o silence.o speed.o \ | |
| 33 | 33 | stat.o stretch.o swap.o synth.o trim.o vibro.o vol.o |
| 34 | 34 | |
| 35 | 35 | SOUNDLIB = libst.a |
| @@ -49,7 +49,7 @@ FOBJ = 8svx.o adpcm.o aiff.o au.o auto.o avr.o cdr.o \ · 48 unmodified lines | ||
| 49 | 49 | EOBJ = avg.o band.o bandpass.o breject.o btrworth.o chorus.o compand.o \ |
| 50 | 50 | copy.o dcshift.o deemphas.o earwax.o echo.o echos.o \ |
| 51 | 51 | fade.o filter.o flanger.o highp.o highpass.o lowp.o \ |
| 52 | − lowpass.o mask.o pan.o phaser.o pitch.o polyphas.o \ | |
| 52 | + lowpass.o mask.o mcompand.o pan.o phaser.o pitch.o polyphas.o \ | |
| 53 | 53 | rate.o repeat.o resample.o reverb.o reverse.o silence.o speed.o \ |
| 54 | 54 | stat.o stretch.o swap.o synth.o trim.o vibro.o vol.o |
| 55 | 55 | |
| @@ -465,6 +465,9 @@ st_effect_t st_effects[] = { · 464 unmodified lines | ||
| 465 | 465 | {"mask", ST_EFF_MCHAN, |
| 466 | 466 | st_mask_getopts, st_effect_nothing, st_mask_flow, |
| 467 | 467 | st_effect_nothing_drain, st_effect_nothing}, |
| 468 | + {"mcompand", ST_EFF_MCHAN, | |
| 469 | + st_mcompand_getopts, st_mcompand_start, st_mcompand_flow, | |
| 470 | + st_mcompand_drain, st_mcompand_stop}, | |
| 468 | 471 | {"pan", ST_EFF_MCHAN | ST_EFF_CHAN, |
| 469 | 472 | st_pan_getopts, st_pan_start, st_pan_flow, |
| 470 | 473 | st_effect_nothing_drain, st_pan_stop}, |
| @@ -72,7 +72,7 @@ formats, and effect options." · 71 unmodified lines | ||
| 72 | 72 | # loop over arguments |
| 73 | 73 | while [ $# -ne 0 ]; do |
| 74 | 74 | case "$1" in |
| 75 | − avg|band|bandpass|bandreject|chorus|compand|copy|cut|deemph|earwax|echo|echos|fade|filter|flanger|highp|highpass|lowp|lowpass|map|mask|pan|phaser|pick|pitch|polyphase|rate|repeat|resample|reverb|reverse|silence|speed|split|stat|stretch|swap|trim|vibro|vol) | |
| 75 | + avg|band|bandpass|bandreject|chorus|compand|copy|cut|deemph|earwax|echo|echos|fade|filter|flanger|highp|highpass|lowp|lowpass|map|mask|mcompand|pan|phaser|pick|pitch|polyphase|rate|repeat|resample|reverb|reverse|silence|speed|split|stat|stretch|swap|trim|vibro|vol) | |
| 76 | 76 | effects="$@" |
| 77 | 77 | break |
| 78 | 78 | ;; |
| @@ -487,6 +487,13 @@ int st_mask_getopts(eff_t effp, int argc, char **argv); · 486 unmodified lines | ||
| 487 | 487 | int st_mask_flow(eff_t effp, st_sample_t *ibuf, st_sample_t *obuf, |
| 488 | 488 | st_size_t *isamp, st_size_t *osamp); |
| 489 | 489 | |
| 490 | +int st_mcompand_getopts(eff_t effp, int argc, char **argv); | |
| 491 | +int st_mcompand_start(eff_t effp); | |
| 492 | +int st_mcompand_flow(eff_t effp, st_sample_t *ibuf, st_sample_t *obuf, | |
| 493 | + st_size_t *isamp, st_size_t *osamp); | |
| 494 | +int st_mcompand_drain(eff_t effp, st_sample_t *obuf, st_size_t *osamp); | |
| 495 | +int st_mcompand_stop(eff_t effp); | |
| 496 | + | |
| 490 | 497 | int st_pan_getopts(eff_t effp, int argc, char **argv); |
| 491 | 498 | int st_pan_start(eff_t effp); |
| 492 | 499 | int st_pan_flow(eff_t effp, st_sample_t *ibuf, st_sample_t *obuf, |