shithub: sox

Download patch

ref: e81132de6cd16b432e6a14bb0c4a1f8e2c01a1ae
parent: 6c5a354369d45ef8d0da13bdc9d459a05bdd2472
author: robs <robs>
date: Fri Jun 15 17:58:33 EDT 2007

oops effect

--- a/soxeffect.7
+++ b/soxeffect.7
@@ -543,6 +543,13 @@
 	sox noisy.au -n trim 0 1 noiseprof | play noisy.au noisered
 .EE
 .TP
+\fBoops\fR
+Out Of Phase Stereo effect.
+Mixes stereo to twin-mono where each mono channel contains the
+difference between the left and right stereo channels.
+This is sometimes known as the karaoke effect as it often has the effect
+of removing most or all of the vocals from a recording.
+.TP
 \fBpad\fR { \fIlength\fR[\fB@\fIposition\fR] }
 Pad the audio with silence, at the beginning, the end, or any
 specified points through the audio.
--- a/src/effects.h
+++ b/src/effects.h
@@ -30,6 +30,7 @@
   EFFECT(mixer)
   EFFECT(noiseprof)
   EFFECT(noisered)
+  EFFECT(oops)
   EFFECT(pad)
   EFFECT(pan)
   EFFECT(phaser)
--- a/src/mixer.c
+++ b/src/mixer.c
@@ -559,3 +559,19 @@
   handler.name = "pick";
   return &handler;
 }
+
+static int oops_getopts(sox_effect_t * effp, int n, char * * argv) 
+{
+  char * args[] = {"1,-1,-1,1"};
+  return sox_mixer_effect_fn()->getopts(effp, array_length(args), args);
+}
+
+sox_effect_handler_t const * sox_oops_effect_fn(void)
+{
+  static sox_effect_handler_t handler;
+  handler = *sox_mixer_effect_fn();
+  handler.name = "oops";
+  handler.usage = NULL;
+  handler.getopts = oops_getopts;
+  return &handler;
+}