» AviSynth is a powerful video FrameServer for Win32.

AviSynth Links:
»Learn to script
»Discussion fora
»Project page
»External filters

» You can add pages to this website immediately. No login required.
Edit this document

» AboutAviSynth




( Diese Seite in flag-germany.gif Deutsch )

ResampleAudio(clip, int new_rate_numerator [, int new_rate_denominator])

ResampleAudio performs a high-quality change of audio sample rate.

The conversion is skipped if the samplerate is already at the given rate.

When using fractional resampling the output audio samplerate is given by :

int(new_rate_numerator / new_rate_denominator + 0.5)

However the internally the resampling factor used is :

new_rate_numerator / (new_rate_denominator * old_sample_rate)

This causes the audio duration to vary slightly (which is generally what is desired).

Starting from v2.53 ResampleAudio accepts any number of channels.

Starting from v2.56 ResampleAudio process float samples directly. Support fractional resampling.

# resamples audio to 48 kHz
source = AviSource("c:\audio.wav")
return ResampleAudio(source, 48000)
# Exact 4% speed up for Pal telecine
Global Nfr_num=25
Global Nfr_den=1
AviSource("C:\Film.avi") # 23.976 fps, 44100Hz
ResampleAudio(Ar*FramerateNumerator()*Nfr_den, FramerateDenominator()*Nfr_num)
AssumeFPS(Nfr_num, Nfr_den, False)

For exact resampling the intermediate samplerate needs to be 42293.706293 which if rounded to 42294 would causes about 30ms per hour variation.


v2.56 added new_sample_rate=float

SourceForge Logo


Edit this document | View document history
Document last modified Sun, 30 Jan 2005 10:49:23