GetChannel のバックアップソース(No.2)

 GetChannel(clip clip, int ch1 [, int ch2, ...])

 GetLeftChannel(clip clip)

 GetRightChannel(clip clip)

v2.5以前は、[[GetLeftChannel>GetChannel]]でステレオ信号の左のチャンネルを、[[GetRightChannel>GetChannel]]で右のチャンネルを取得することができました。GetChannelはv2.5から登場したフィルタで、マルチチャンネル信号から、1つ、ないし複数のチャンネルを取得することができます。チャンネルの順序は、入力ファイルの順序によって決定されます。というのも、AviSynthは、順序を仮定するようなことはしないからです。ステレオ2.0ch WAVと5.1ch WAVの場合、順序は次のようになるでしょう:

''WAV 2 ch (stereo):''

|1|左チャンネル|
|2|右チャンネル|

''WAV 5.1 ch:''((LFE(Low Frequency Effects): 低音域効果。))

|1|前方左チャンネル|
|2|前方右チャンネル|
|3|前方中央チャンネル|
|4|LFE(サブウーファー)|
|5|後方左チャンネル|
|6|後方右チャンネル|

Examples:

 # Removes right channel information, and return as mono clip with only left channel:
 video = AviSource("c:\filename.avi")
 stereo = WavSource("c:\afx-ab3_t4.wav")
 mono = GetLeftChannel(stereo)
 return AudioDub(video, mono)

 # Using v2.5 this becomes:
 video = AviSource("c:\filename.avi")
 stereo = WavSource("c:\afx-ab3_t4.wav")
 mono = GetChannel(stereo, 1)
 return AudioDub(video, mono)

 # You could also obtain the channels from the avi file itself:
 video = AviSource("c:\filename.avi")
 return GetChannel(video, 1)

 # Converts avi with "uncompressed 5.1 wav" audio to a stereo signal:
 video = AviSource("c:\divx_wav.avi")
 audio = WavSource(c:\divx_wav.avi)
 stereo = GetChannel(audio, 1, 2)
 return AudioDub(video, stereo)

''Remark1:''

Every file format has a different channel ordening. The following table gives this ordening for some formats (useful for plugin writers :))

|reference:|channel 1:|channel 2:|channel 3:|channel 4:|channel 5:|channel 6:|h
|~[[[5.1 WAV]:http://www.cs.bath.ac.uk/~jpff/NOS-DREAM/researchdev/wave-ex/wave_ex.html]]|front left channel|front right channel|front center channel|LFE|rear left channel|rear right channel|
|~[[[5.1 AC3]:http://www.atsc.org/standards/a_52a.pdf]]|front left channel|front center channel|front right channel|rear left channel|rear right channel|LFE|
|~[[[5.1 DTS]:http://webapp.etsi.org/action%5CPU/20020827/ts_102114v010101p.pdf]]|front center channel|front left channel|front right channel|rear left channel|rear right channel|LFE|
|~[[[5.1 AAC]:http://www.hydrogenaudio.org/index.php?showtopic=10986]]|front center channel|front left channel|front right channel|rear left channel|rear right channel|LFE|
|~[[[5.1 AIFF]:http://preserve.harvard.edu/standards/Audio%20IFF%20Specification%201%203.pdf]]|front left channel|rear left channel|front center channel|front right channel|rear right channel|LFE|

-5.1 DTS: the LFE is on a separate stream (much like on multichannel MPEG2).
-AAC specifications are unavailable on the internet (a free version)?

''Remark2:''

At the time of writing, BeSweet still has the [[[2GB barrier]:http://forum.doom9.org/showthread.php?s=&postid=305084]]. So make sure that the size of the 5.1 WAV is below 2GB, otherwise encode to six separate wavs or use HeadAC3he.

''Remark3:''

GetChannels is an alias to GetChannel and they can be used interchangeably. The syntax is the same for both.