PDA

View Full Version : wavsource and loop function


Dark-Cracker
15th August 2003, 14:33
Hi,

i have made a little script to loop an avi 6 time.

----------
Source = "T03_source.avi"

clip = aviSource(Source,false).loop(6)
audio=wavsource("sound.wav").resampleaudio(44100)

audio=audio.loop(6)

final=audiodub(clip, audio).bilinearresize(512,224).trim(1,0)

return final
-------------

i have first test to mux audio and video using audiodub and made a loop but once the second loop start i don't have sound.

i have try to made the loop before the audiodub but same result.

finaly the only way is to replace :

-----------
audio=audio.loop(6)

by

audio=audio+audio+audio+audio+audio+audio
-----------

apparently the loop function doesn't work on audio file.
perhaps someone could made a test to see if he have the same problem in order to help avisynth team to fix this bug :)

Bye.

DocDragon
19th July 2004, 06:05
Originally posted by Dark-Cracker
[...]
-----------
audio=audio.loop(6)

by

audio=audio+audio+audio+audio+audio+audio
-----------

apparently the loop function doesn't work on audio file.
perhaps someone could made a test to see if he have the same problem in order to help avisynth team to fix this bug :)

Bye.

thanks a lot for posting your findings. i had to fight with the same problem and finally realized that "loop" unfortunately does not work with audio clips although that would be the next logical thing to do. maybe that should be mentioned in the manual.

you just solved my problem with a "less" elegant solution (audio=audio+audio+...) :D

well, at least this is documented for others in the forum...

DD

sh0dan
19th July 2004, 08:33
Are you using the latest 2.5.5 beta?

The latest had this fix:
- Loop should now support all kinds of audio.

stickboy
19th July 2004, 09:34
I'm using the latest alpha build, and WAVSource("foo.wav").Loop(2) throws an unrecognized exception.

Looking at the Loop source code, it doesn't seem surprising... it uses a lot of values from the VideoInfo struct that I wouldn't expect to be legitimate. (vi.fps_numerator is 0, which causes a divide-by-zero.)

sh0dan
19th July 2004, 10:35
Thanks!

Seems like a clean fix!

Applied!

stickboy
20th July 2004, 08:29
Actually, I think it still doesn't work. (When I realized that, I removed the link to my patch, but I guess not soon enough.)

It seemed to work for Loop(2) but not for higher values... I'll look into it more later.

sh0dan
20th July 2004, 09:42
Yes, it should have been:

loop_ends_at_sample = vi.num_audio_samples * times;

- but otherwise it seems fine.

Moving to development.