View Full Version : Stretching audio in avisynth
The Belgain
21st November 2002, 01:34
Is there a way to stretch audio in AviSynth? I have an audio file whose length is 21:20 which should match up with a 21:24 video file. At the moment the audio is about 4 secs ahead of the video by the end of the clip.
If not, what external program could I use to do this (I have the audio as a seperate wav)?
droolian01
21st November 2002, 04:44
Hi there.
My fave is 'cool edit pro'. Its dead easy to just type in the new length of audio you need - it is usually only a couple of thousanths of a second out.
Hope this helps.
sh0dan
21st November 2002, 09:19
The easiest way will probably be to change the samplerate. This will make it sound much better than time-stretching in CoolEdit.
If you use the CVS binary (URL below), you can use:
If your audio is 44.1khz, use
Assumesamplerate(43963)
resampleaudio(44100)
Otherwise just multiply the original samplerate by 1280 and divide it by 1284.
86peaches
21st November 2002, 14:42
shodan, does the above method work as effectively when reducing the length of the audio? how does it compare to cooledit?
The Belgain
21st November 2002, 15:16
Thanks for the replies, but I managed to do it using Wave Lenght Adjust 0.26 which I found on this site.
sh0dan
21st November 2002, 15:17
In contrast to the cooledit way, this method also changes the pitch of the sound. However, since the change in speed is so very, very small I promise you, you'll not be able to hear the difference.
(Many people also use this method for 24->25fps change, which is a much larger difference).
Using the time-stretch, the pitch will not change, but you'll get many artifacts from the transform, since it splits all your samples spectrally. You will lose attack clarity (one of the biggest problems of time-stretching), and proably high-pitch clearity.
In the end your sound will be better, if you simply resample. You can use the internal resampler in Cooledit - it probably has better quality than the AviSynth one, or you can try SSRC.
Wilbert
21st November 2002, 15:28
or you can try SSRC
... and Wavefix to change the header back to 44100 Hz.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.