AfterDawn.com

Audio Filters



Even though AviSynth is primarily a video editing tool, some basic audio editing filters are also available.




SSRC


SSRC(clip Clip, int samplerate, bool fast)

ArgumentTypeDefaultReqDescription
ClipCliplastClip to resample audio from
samplerateInteger*Destination samplerate
fastBooleanTruePerform faster/less accurate conversion


SSRC can resample the audio in a clip. It's particularly useful for either converting between the two most common sample formats, CD's 44100Hz and DVD's 48000Hz. It can also be used to make audio streams which have been resampled with AssumeFPS back to standard (destination-compliant) sampling.

samplerate
Standard samplerates are 44100 for CD/VCD and 48000 for DVD and DTV.

fast
With Fast on it will take less time for SSRC to convert your samplerate, but the resulting quality will be lower. In most cases you should set it to False.

Example Code

Resample from VCD to DVD:
V = Mpeg2Source(VCD_Video.d2v)
A = DirectShowSource("VCD_Audio.mpa")
Audiodub(V, A)
SSRC(48000, fast=False)

Resample after stretching audio with AssumeFPS:
AssumeFPS(25, sync_audio=True).SSRC(48000, fast=False)

When To Use It

When you either have an odd samplerate like what AssumeFPS gives you or an audio stream sampled for a different spec, SSRC will usually be able to resample for you. It's particularly useful for standards conversion (PAL to NTSC or NTSC to PAL)
Written by: Rich Fiscus