Package: sox
Version: 12.17.7-3
Severity: normal
Tags: patch

The sox manpage references being able to remove silence in the
middle of file using the silence plugin, but when trying it, the
arguments parsing code would always indicate that an invalid
argument was specified.  It turns out that silence removal in
the middle of a file does work if the command-line arguments
are passing in as specified in the manpage.

I'm attaching a patch file that includes the patch for 
silence.c and corrects a simple typo in the manpage regarding
the silence plugin.

Thanks!
tony

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages sox depends on:
ii  libc6                        2.3.5-4     GNU C Library: Shared libraries an
ii  libmad0                      0.15.1b-2.1 MPEG audio decoder library
ii  libogg0                      1.1.2-1     Ogg Bitstream Library
ii  libvorbis0a                  1.1.0-1     The Vorbis General Audio Compressi
ii  libvorbisenc2                1.1.0-1     The Vorbis General Audio Compressi
ii  libvorbisfile3               1.1.0-1     The Vorbis General Audio Compressi

sox recommends no packages.

-- no debconf information
diff -ruN sox-12.17.7-old/sox.1 sox-12.17.7/sox.1
--- sox-12.17.7-old/sox.1       2004-12-20 11:43:48.000000000 -0800
+++ sox-12.17.7/sox.1   2005-08-22 17:40:58.000000000 -0700
@@ -1186,7 +1186,7 @@
 .br
 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 specify 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.
 .br
-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 \fIbelow_periods\fR is negative, it is treated 
as a positive value and is also used to indicate the effect should restart 
processing as specified by the \fIabove_periods\fR, making it suitable for 
removing periods of silence in the middle of a sound file.
+When optionally trimming silence from 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 \fIbelow_periods\fR is negative, it is treated 
as a positive value and is also used to indicate the effect should restart 
processing as specified by the \fIabove_periods\fR, making it suitable for 
removing periods of silence in the middle of a sound file.
 .br
 Duration counts may be in the format of time, hh:mm:ss.frac, or in the exact 
count of samples.
 .br
diff -ruN sox-12.17.7-old/src/silence.c sox-12.17.7/src/silence.c
--- sox-12.17.7-old/src/silence.c       2004-09-27 19:33:09.000000000 -0700
+++ sox-12.17.7/src/silence.c   2005-08-22 17:39:17.000000000 -0700
@@ -164,8 +164,12 @@
         {
             silence->stop_periods = -silence->stop_periods;
             silence->restart = 1;
-            st_fail("Periods must not be greater then zero");
-            return(ST_EOF);
+            /* 20050822/tm - negative stop_periods == silence remove
+                        * throughout a file (refer to manpage)
+                        *
+                        * st_fail("Periods must not be greater then zero");
+             * return(ST_EOF); 
+                        */
         }
         else
             silence->restart = 0;

Reply via email to