View Full Version : audio discontinuities
raymod2
31st December 2005, 19:12
When I splice clips together in AviSynth I sometimes hear a glitch (pop) at the scene transition. For example, using the following script:
trim(2750,3233) ++ trim(3858,4480)
...I get the audio glitch shown in the attachment. Does anyone know of a way to prevent these or fix them? Would it be difficult to add an option to AlignedSplice() to smooth out the transition for you?
sh0dan
1st January 2006, 20:41
(Moved to development)
How would you suggest that could be done. There usually isn't any overlapping samples after the trim, so we can't do an audio dissolve.
A one-frame Dissolve(a,b,1) could simply be what you need?
foxyshadis
1st January 2006, 21:07
What about just detecting whether the clips include audio, and if so bending both sides toward the median for 5-10 samples (where "bending" is sampleX=sampleX-(sample1-median)/(2*X) where X is sample# (+ or -) relative to discontinuity)?
raymod2
2nd January 2006, 05:49
Thanks, sh0dan, Dissolve() does the trick. Though it's not as convenient as using ++. It would be nice to see something like foxyshadis is describing.
Mug Funky
2nd January 2006, 14:21
you could always run a declicker after it in an audio app... after all that is pretty much just an impulse and quite easy to smooth over.
of course, an avs only solution is fine too.
IanB
2nd January 2006, 15:00
Yes, I have noticed and been annoyed by this in the past. I did some research a while back on how commercial apps dealt with the problem.
Some did a rapid fade-out/fade-in. The times used seemed to ranged from about 2ms to about 20ms. The shorter times tended to turn a sharp click into a slightly less noticable thud. The longer times sometimes caused a sight hole in the sound.
One smarter approach seemed to adjust the fade-out/fade-in such that at the change over point the gain was set so the two values flowed smoothly rather than go to zero.
Whatever we do it should be optional. Samples correctly cut and reassembled should continue to work losslessly.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.