Log in

View Full Version : Loading ONLY audio?


Comatose
25th March 2008, 13:41
Is there a way to load just audio, perhaps by looping a Blackness() clip to the length of the audio?

I guess the question I'm really asking is... how can I find the length of the audio clip in "frames" and "fps"?

If I could find that, I could use Loop() to loop the blackness clip, and all will be well :o

Edit: ugh, nevermind. I figured it out. For those wondering, you can do it like this:
A=*filter to load your audio clip*
V=BlankClip(length=A.framecount).assumefps(A.frameratenumerator,A.frameratedenominator)
audiodub(V, A)
This kind of thing always happens to me... after typing a question, I suddenly realize how :/

IanB
25th March 2008, 22:15
AlsoA=*filter to load your audio clip*
V=A.BlankClip() # Clone all of A's parameters
audiodub(V, A)But note if clip A does not have any associated video both the above and also your solution will fail.

When dealing with Audio, you posibly want to use A.AudioLengthF()/A.AudioRate()=Length in seconds. You can then multiply by FPS to get a frame count. Remember the audio stream can be longer or shorter than the associated video stream (see AlignedSplice versus UnAlignedSplice).