I have several short audio files I would like to merge together, but 2 of the audio files should overlap. Currently I have my script like:
The first audio (a1) is suppose to play for 7 seconds from the beginning. The second audio (a2) is suppose to play for 4 seconds, but start at 5.8 seconds.Code:v=directshowsource("new.avi") a1=directshowsource("sound 1.mp3") a2=directshowsource("sound 13 (over to down ).mp3").delayaudio(5.8) + directshowsource("sound 18 (over to down ).mp3") + directshowsource("sound 25 (over to own ).mp3").delayaudio(3) #a5=directshowsource("sound 27 (over to down ).mp3") #a6=directshowsource("sound 29 (over to down ).mp3") #a7=directshowsource("sound 30 (over to down ).mp3") #a8=directshowsource("sound 32 (over to down ).mp3") #a9=directshowsource("sound 33 (over to down ).mp3") #a10=directshowsource("sound 35 (over to down ).mp3") #a11=directshowsource("sound 36 (over to down ).mp3") a=mixaudio(a1, a2, 0.75, 0.25) audiodub(v,a) lanczosresize(264, 240)
When I play the script, I can hear the first and second audio overlap, but the second audio file ends at the same time as the first. That is not what I want to happen. How do I create a script that will play both audio files while both audio files ends at the time it's suppose to.
+ Reply to Thread
Results 1 to 8 of 8
-
Last edited by mrcoolekin; 11th Feb 2013 at 19:19.
-
This doesn't answer your question directly, but are you still trying to encode the swf to something else?
https://forum.videohelp.com/threads/353270-SWF-to-avi?p=2219286#post2219286
Easiest way is to use a screencapture application, this way you don't have to worry about the timing or sync issues. This is what commercial "swf to xyz" programs do . You could use something like camstudio . Or kmplayer can play the swf, you can use it's capture utility
If you still want to do it this way - for overlapping audio, it would be easier to arrange the tracks in an editor IMO, where you can see the waveform , position, adjust -
What is the video length ? What are the lengths of sound 13, sound 18 , and sound 25 ? You might have to add some padding
Another thing to consider is using another source filter (directshowsource isn't reliable, certainly with video it's not necessarily frame accurate) . You might use FFAudioSource or BassAudioSource -
The video is 38 seconds long. Sound 13 is 4 seconds long, sound 18 is 3 seconds long, and sound 25 is 4 seconds long. Not sure how to add padding to it.
I was never able to get ffaudiosource/ffvideosource to ever work. It only crashes my programs, so that's why I stuck with directshowsource. I did try it again just now and graphedit just crashes all the time. I indexed the files above and wrote a script like this:
Code:loadplugin("C:\Program Files (x86)\AviSynth 2.5\plugins\ffms2.dll") audiodub(ffvideoSource("new.avi"),ffaudiosource("sound 1.mp3")) lanczosresize(264, 240)
Code:loadplugin("C:\Program Files (x86)\AviSynth 2.5\plugins\ffms2.dll") ffvideoSource("new.avi") ffaudiosource("sound 1.mp3") audiodub(v,a) lanczosresize(264, 240)
-
You don't have "v" or "a" labelled
The basic syntax would be something like
Code:vid = AVISource() aud = FFAudioSource() AudioDub(vid,aud)
I think mixing audio willl work better if all audio segments are the same length - you can fill in the "gaps" by padding and using offsets
One way to pad audio with blankaudio is to use blankclip(), you might have to use trim() and add segments to the front and end so the lengths are the same . You have to make sure everything matches , sample rate, channels. You can use SSRC() to resample the audio
I think currently "a2" might be messed up because you have multiple delays . Does it sound ok by itself? You said it was supposed to be 4 seconds ? I don't see how that adds up?
IMO This is why it's much easier in an audio editor - it's automatically padded. Visually it's easy to see where the overlaps are, you just place the clips staggered on the timeline . (And even easier would be to capture the audio)Last edited by poisondeathray; 11th Feb 2013 at 19:48.
-
Oh I just figured it out. I just swapped a2 and a1 since a2 is longer in mixaudio. Now it's working fine.
-
Similar Threads
-
AviSynth: No Audio available for AVI-Files
By klischee in forum EditingReplies: 2Last Post: 18th May 2012, 07:22 -
Merge multiple audio tracks from different files into 1 video file - sync
By heinza in forum Newbie / General discussionsReplies: 2Last Post: 11th Jan 2012, 03:29 -
Is it possible to merge iso-files
By dazler in forum EditingReplies: 7Last Post: 6th Jan 2012, 04:29 -
Confusion with DGIndex, AviSynth, VirtualDub and audio files
By fatcharlie in forum Newbie / General discussionsReplies: 10Last Post: 1st Mar 2011, 15:49 -
How to join 2 avi files into one? together with Audio with avisynth + megui
By squall0833 in forum EditingReplies: 7Last Post: 11th Jul 2010, 09:47