shithub: sox

Download patch

ref: 5d2778c5745aef0ad4af9e4cadef948657c9d336
parent: cd2fbdcf40b712559c96020467f5628e7e2c71d5
author: robs <robs>
date: Sat Oct 25 11:12:10 EDT 2008

un-deprecate stretch

--- a/ChangeLog
+++ b/ChangeLog
@@ -19,7 +19,6 @@
   Deprec-  Feature    [O(ption)]                           Removal
   ated in  [F(ormat)] [E(ffect)]   Replacement             due after
   -------  ----------------------  ----------------------  -------
-  14.0.0   E stretch               ~= tempo                14.2.0 + 6 months
   14.1.0   E resample              ~= rate                 2009-01-29
   14.1.0   E polyphase             ~= rate                 2009-01-29
   14.1.0   E rabbit                ~= rate                 2009-01-29
--- a/README
+++ b/README
@@ -146,7 +146,8 @@
     o bend		Bend pitch at given times without changing tempo
     o pitch		Adjust pitch (= key) without changing tempo
     o speed		Adjust pitch & tempo together
-    o tempo		Adjust tempo without changing pitch
+    o stretch		Adjust tempo without changing pitch (simple alg.)
+    o tempo		Adjust tempo without changing pitch (WSOLA alg.)
 
   o Mastering effects
     o dither		Add dither noise to increase SNR of <= 16-bit audio
--- a/sox.1
+++ b/sox.1
@@ -2764,6 +2764,36 @@
 .B remix
 effect.
 .TP
+\fBstretch \fIfactor\fR [\fIwindow fade shift fading\fR]
+Change the audio duration (but not its pitch).
+This effect is broadly equivalent to the
+.B tempo
+effect with (\fIfactor\fR inverted and)
+.I search
+set to zero, so in general, its results are comparatively poor;
+it is retained as it can sometimes out-perform
+.B tempo
+for small
+.IR factor s.
+.SP
+.I factor
+of stretching: >1 lengthen, <1 shorten duration.
+.I window
+size is in ms.  Default is 20ms.  The
+.I fade
+option, can be `lin'.
+.I shift
+ratio, in [0 1].  Default depends on stretch factor. 1
+to shorten, 0\*d8 to lengthen.  The
+.I fading
+ratio, in [0 0\*d5].  The amount of a fade's default depends on
+.I factor
+and \fIshift\fR.
+.SP
+See also the
+.B tempo
+effect.
+.TP
 \fBsynth\fR [\fIlen\fR] {[\fItype\fR] [\fIcombine\fR] [[\fB%\fR]\fIfreq\fR[\fBk\fR][\fB:\fR\^|\^\fB+\fR\^|\^\fB/\fR\^|\^\fB\-\fR[\fB%\fR]\fIfreq2\fR[\fBk\fR]]] [\fIoff\fR] [\fIph\fR] [\fIp1\fR] [\fIp2\fR] [\fIp3\fR]}
 This effect can be used to generate fixed or swept frequency audio tones
 with various wave shapes, or to generate wide-band noise of various
--- a/src/stretch.c
+++ b/src/stretch.c
@@ -317,7 +317,7 @@
     "factor [window fade shift fading]\n"
     "       (expansion, frame in ms, lin/..., unit<1.0, unit<0.5)\n"
     "       (defaults: 1.0 20 lin ...)",
-    SOX_EFF_LENGTH | SOX_EFF_DEPRECATED,
+    SOX_EFF_LENGTH,
     getopts, start, flow, drain, stop, NULL, sizeof(priv_t)
   };
   return &handler;