Home
RecentChanges

Search:

» AviSynth is a powerful video FrameServer for Win32.

AviSynth Links:
»Download
»Learn to script
»FAQ
»Manual
»Discussion fora
»Project page
»External filters
»FeedBack

» You can add pages to this website immediately. No login required.
Edit this document

» AboutAviSynth

 

Avisynth 
Logo

MixAudio

( Diese Seite in flag-germany.gif Deutsch )

MixAudio(clip1 clip, clip2 clip, float clip1_factor, float clip2_factor)

Mixes audio from two clips. A volume for the two clips can be given, but is optional.

Volume is given as a factor, where 0.0 is no audio from the desired channel, and 1.0 is 100% from the desired channel. Default is 0.5/0.5 - if only one factor is given, the other channel will be 1.0-(factor). If factor1 + factor2 is more than 1.0, you risk clipping your signal.

The sample rate of the two clips needs to be the same (use ResampleAudio if necessary). Your clips need also to have the same number of channels (stereo/mono) - use ConvertToMono or MonoToStereo / MergeChannels if necessary.

Example:

# mixes two sources, with one source slightly lower than the other.
video = AviSource("c:\movie.avi")
Soundtrack = WavSource("c:\soundtrack.wav")
Speak = WavSource("c:\speak.wav")
audio = MixAudio(Soundtrack, Speak, 0.75, 0.25)  # The Expert may notice that the last 0.25 is actually redundant here.
return AudioDub(video, audio)

SourceForge Logo

 


Edit this document | View document history
Document last modified Sun, 30 Jan 2005 10:45:38