#90 ResampleAudio - args should be similar to ChangeFPS et al

Filters (44)

Okay, so I've got two pretty different clips. One is
RGB24, 10fps, mono 22kHz. I want to prepend SMTPE
color bars (30fps, stereo 48kHz). (I'm doing this to
space out clips, it's research).

Okay, so I've got this (tried with AVS 2.5.7 alpha):

video = AviSource("D:\wierd video.avi")
video = ConvertToRGB24(video)

#Get the audio rate of the clip.
ar = AudioRate(video)

#Duplicate the mono channel.
left = GetChannel(video, 1)
stereo = mergeChannels(left, left)
video = AudioDub(video, stereo)

bars = ConvertToRGB24(ColorBars())
bars = bars.ChangeFPS(video)
#Should work, but doesn't
#bars = bars.ResampleAudio(video) <-- This line
#Does work, but seems silly
bars = bars.ResampleAudio(ar)

bars.Trim(0,100) ++ video

And it works, sure. But it seems like ChangeFPS and
ResampleAudio should take similar parameters. RsA
should be able to accept a clip as an argument, not
just a float or fraction. Is there a specific reason
why not? Your left and right channels have to have
the same audiorate anyway, or at least I thought.

I can imagine that sometimes you'd want
ResampleAudio(clip1, clip2) or
clip2 = clip2.ResampleAudio(clip1) not


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks