Great! I’m looking forward to testing the official build.
While I’m an experienced C/C++ developer, this is the first time I officially contributed to an open source project. I want to thank the SoX team for taking my submissions and fixing them so they work on the wide variety of machines supported by SoX. I learned a lot by paying attention the changes that were made to my patches. I tried to match to coding standards and formatting used by SoX. I think I did a pretty good job, but clearly far from 100% (though the biggest reformatting I saw was for functions I pulled whole out of LAME with attribution).
I do want to remind you of an additional contribution that may have been missed. Bug 2861362 opened by me Sept., 18,2009, “Tempo effect documentation out of date”. The problem is the tempo effect, which is really great, will probably not be usable following the old documentation.
For your convenience I have appended the text of the bug.
Thanks for your consideration,
Tempo effect documentation out of date - ID: 2861362
This is an old one but I've been away.
tempo.c revision 1.15, Wed Oct 15 19:57:16 2008 UTC, changed the way tempo
parameters are specified. The new behavior is (as far as I can tell)
undocumented. The advice provided in the existing documentation is no
longer appropriate. Specifically:
"When changing the tempo of speech, a segment size of around 30 ms often
In fact prior to the change this command:
sox InFile.mp3 OutFile.mp3 tempo 1.25 30
While being somewhat compute intensive, resulted in files that were very
listenable. Prior to the change that command would mean:
sox InFile.mp3 OutFile.mp3 tempo 1.25 30 14 12
But now it means:
sox InFile.mp3 OutFile.mp3 tempo 1.25 30 5.36961 4.39046
Which runs much faster but results in obvious and distracting distortion
(though the result is admittedly intelligible). With the update this should
now be recommend:
"When changing the tempo of speech, using the -s switch is recommended for
sox InFile.mp3 OutFile.mp3 tempo -s 1.25"
Using the -s "speech" switch with a tempo of 1.25 the parameters are
calculated and the call is equivalent to:
sox InFile.mp3 OutFile.mp3 tempo 1.25 32.5153 15.1941 13.0061
Which as desired slowly produces a very listenable effect.
Unfortunately I can't find your documentation source in the project. I
submit a documentation patch here (the rest of this comment replaces entire
tempo section in effects documentation):
tempo [-q] [-m | -s | -l] factor [segment [search [overlap]]]
Change the audio tempo (but not its pitch) using the WSOLA algorithm. The
audio is chopped up into segments which are then shifted in the time domain
and overlapped (cross-faded) at points where their waveforms are most
By default, linear searches are used to find the best overlapping points;
if the optional −q parameter is given, tree searches are used instead,
giving a quicker, but possibly lower quality, result. If you must increase
processing speed, the distortion caused by the faster search is usually
less harsh then the alternatives (e.g. decreasing search and/or overlap).
The –m option is used to optimize default values of segment, search and
overlap for music processing.
The –s option is used to optimize default values of segment, search and
overlap for speech processing.
The –l option is used to adjust default values of segment, search and
overlap for fast ‘linear’ processing that tends to cause more
noticeable distortion but may be useful when factor is close to 1.
If–m, –s, or –l is specified, the default value of segment will be
calculated based on factor, while default search and overlap values are
based on segment. Any values you provide still override these default
factor gives the ratio of new tempo to the old tempo, so e.g. 1.1 speeds up
the tempo by 10%, and 0.9 slows it down by 10% (i.e. the output duration
times factor approximately equals the input duration)
The optional segment parameter selects the algorithm’s segment size in
milliseconds. Though flags can affect this, the default value is 82 which
is typically suited to making small changes to the tempo of music; for
larger changes (e.g. a factor of 2), 41 ms may give a better result. Use of
the -m, -s, or -l flags will cause the segment default to be automatically
adjusted based on factor. For example using –s for speech with a tempo of
1.25 will calculate a default segment value of 32.
The optional search parameter gives the audio length in milliseconds over
which the algorithm will search for overlapping points. Default value is
14.68, but -m, -s, or -l flags automatically adjust search based on segment
size. Larger values use more processing time and may or may not produce
better results. A practical maximum is half the value of segment. Search
can be reduced to cut processing time at the risk of degrading output
The optional overlap parameter gives the segment overlap length in
milliseconds. Default value is 12, but -m, -s, or -l flags automatically
adjust overlap based on segment size. Increasing overlap increases
processing time and may increase quality. A practical maximum for overlap
is the value of search, with overlap typically being (at least) a little
smaller then search.
When changing the tempo of speech, use the –s option and specify factor.
The remaining options will default to values intended to minimize obvious
distortion. Processing will tend to be slow, but just enough to ensure
quality. If you want to see the actual values used for segment, search and
overlap, set the verbosity level to show processing details using (at
least) the –V3 global option.
Convert 5 hours of spoken audio to 4 hours using this tempo effect:
sox InFile.mp3 OutFile.mp3 tempo –s 1.25
See also speed for an effect that changes tempo and pitch together, pitch
for an effect that changes tempo and pitch together, and stretch for an
effect that changes tempo using a different algorithm.
From: Chris Bagwell [mailto:chris@...]
Sent: Sunday, December 06, 2009 7:55 PM
To: sox-users@...; sox-devel@...
Subject: [SoX-devel] SoX 14.3.1 Release Candidate 1
I've just uploaded the first release candidate for SoX 14.3.1. I hope to be able to make the official release before the new year. Your testing will help to make that possible.
If you would like to see what is new in this release, you can view the online ChangeLog:
http://sox.cvs.sourceforge.net/viewvc/sox/sox/ChangeLog?revision=1.263 <http://sox.cvs.sourceforge.net/viewvc/sox/sox/ChangeLog?revision=1.263&view=markup> &view=markup
Source code and a win32 binary can be downloaded from: