Log in

View Full Version : SwitchByAudio Plugin Discussion


vcmohan
1st February 2013, 13:38
SwitchByAudio (http://avisynth.org/vcmohan/SwitchByAudio/SwitchByAudio.html) Plugin: Depending on the audio level and length detects a pause and switches output between two clips.
Took some time to find out the form of representing +ve and -ve audio values. Now I think the plugin works correctly.

vcmohan
4th February 2013, 11:26
Added facilty for defining the switching point during pause. The switchat parameter 0 corresponds to beginning frame and 10 to ending frame of the pause.
checked with the script
ColorBars(). trim (0, 119).converttoYV12()
p = ColorBars(). trim (0, 29).converttoYV12()
a = audiodub(p,Tone(length=1,level=0.9))
b = audiodub(p,Tone(length=1,level=0.1))
c= audiodub(p,Tone(length=1,level=0.8))
d=audiodub(p,Tone(length=1,level=0.1))
e = audiodub(p,Tone(length=1,level=0.7))
f = audiodub(p,Tone(length=1,level=0.1))
g= audiodub(p,Tone(length=1,level=0.6))
h=audiodub(p,Tone(length=1,level=0.1))
l=a++a++b++c++c++d++e++e++f++g++g++h++a++a
R= flipvertical(l)
s= l.converttoMono()
s= s.convertAudioto8bit()
switchbyaudio(l,r,s, psec=0.5, plevel = 25, switchat = 5)