MergeChannels

From Avisynth wiki
Revision as of 17:02, 9 May 2013 by Admin (Talk | contribs)

Jump to: navigation, search

MergeChannels(clip1 clip, clip2 clip [, clip3 clip])

Starting from v2.5 MergeChannels replaces MonoToStereo, and can be used to merge the audio channels of two or more clips. Don't confuse this with mixing of channels (MixAudio and ConvertToMono do this) - the sound of each channel is left untouched, the channels are only put into the new clip.

Before merging audio is converted to the sample type of clip1.

Example, converts "uncompressed wav" audio to a 44.1 kHz stereo signal:

video = AviSource("c:\divx_wav.avi")
audio = WavSource("c:\divx_wav.avi")
l_ch = GetChannel(audio, 1)
r_ch = GetChannel(audio, 2)
stereo = MergeChannels(l_ch, r_ch).ResampleAudio(44100)
return AudioDub(video, stereo)

Note, this is the same as:

video = AviSource("c:\divx_wav.avi")
audio = WavSource("c:\divx_wav.avi")
stereo = GetChannel(audio, 1, 2).ResampleAudio(44100)
return AudioDub(video, stereo)
Personal tools