Log in

View Full Version : WavSource and framecount bug?


Guest
4th January 2005, 17:00
I'm having troubles with wavsource and framelength.

bname = "D:\test.jpg"
audiotrack = wavSource("D:\musictester.wav").ConvertToMono.SSRC(48000)
am = Imagereader(bname,1,1,25).converttoyv12()
am = loop(am,audiotrack.framecount)

This is is giving me a crazy length - what is happening?

Is there another way to get the framecount of a wav file?

[edit: found audiolength(), but that is also resulting in wierd numbers]

Tin2tin

stickboy
4th January 2005, 18:56
What on earth is the frame count of an audio file? What is a frame? What is the framerate?

Those terms only make sense when applied to a clip with video.

Guest
4th January 2005, 20:27
The reason is, that I need to trim a specific part of the wav before adding it to a specific part of an avi.

So in order to trim the wav I must add an image to it, but I only want to add image to the length of the wav - and not any longer.

Later I will just use the trimmed wav to dub it to the avi.

I hope this makes more sense...

Tin2tin

Wilbert
4th January 2005, 20:38
c = WavSource(...)
c.AudioLengthF/c.AudioRate

gives the length of the audio in seconds.

To make it visible


c = WavSource(...)
t = c.AudioLengthF/c.AudioRate
c.Subtitle(string(t))


If you want to mux it with your video (using audiodub) which is shorter you need to calculate how much seconds (or samples) you need to cut.
This is given by the 'number of frames' divided by the 'framerate' of the video clip.

Guest
4th January 2005, 23:33
Thanks!!:) :)
Tin2tin