Log in

View Full Version : Invert audio filter?


Reel.Deel
8th June 2023, 20:21
Hi there people,

Does anyone know of a way to invert the audio in AviSynth? I have searched but came up empty handed. I'm sure it's not a common thing people do but audio editors do have a way to invert (flip) the audio.

Dogway
8th June 2023, 20:40
Maybe Reverse().Killvideo()?

StainlessS
8th June 2023, 20:55
Clarification, You mean, +ve peaks become -ve, and -ve peaks become +ve ?
Yes.
(cant help, just dont think Doggy understood)

Reel.Deel
8th June 2023, 21:01
Maybe Reverse().Killvideo()?

That would reverse the audio. Audio invert (also known as polarity invert, phase invert and others) is more like the filter Invert() for video. It basically flips the waveform 180 degrees.

https://i.ibb.co/b2YmpG8/audioinvert.png

Edit
Clarification, You mean, +ve peaks become -ve, and -ve peaks become +ve ?


Yep.

Dogway
8th June 2023, 21:49
Ah yes, flip the waveform, basically you multiply the audio by -1.0. In this regard it's like amplifying negatively, Amplify() (http://avisynth.nl/index.php/AmplifydB) already has that built in I think. Amplify(-1) by the examples.

StainlessS
8th June 2023, 21:59
A=Colorbars
B=A.Amplify(-1.0)

A=A.Waveform_Filmstrip(window=1,under=true,SubSize=0.25)
B=B.Waveform_Filmstrip(window=1,under=true,SubSize=0.25)

StackVertical(A,B)

https://i.postimg.cc/7ZXMDBfC/test-00.jpg (https://postimages.org/)
Only showing 1 (upper) channel [the other channel was silent for that colorbars frame].

Good Dog. https://www.cosgan.de/images/smilie/tiere/n020.gif

Reel.Deel
8th June 2023, 22:07
Ah yes, flip the waveform, basically you multiply the audio by -1.0. In this regard it's like amplifying negatively, Amplify() (http://avisynth.nl/index.php/AmplifydB) already has that built in I think. Amplify(-1) by the examples.

Dang, now I feel like a dummy. I even updated the documentation for the avs+ page :o. I vaguely recall reading something but I kept looking for "invert audio avisynth" and the Amplify page does not come up on Google. Thanks Dogway!

TCmullet
28th April 2024, 23:15
Oh wow. THANK YOU all for asking and answering this! I've done audio inversion many times in CoolEdit and Audacity, but today is the first time I needed it for audio within Avisynth! I thought SURE it was there somewhere, but couldn't find any reference to it. Nice that Amplify allows negative values! It works! THANK YOU all! (Maybe the documentation for Amplify could be updated to inform of what a negative value does.)