GetChannel(clip clip, int ch1 [, int ch2, ...] )
GetChannels(clip clip, int ch1 [, int ch2, ...] )
- GetChannel returns one or more channels of a multichannel signal.
- GetLeftChannel returns the left channel from a stereo signal, and GetRightChannel returns the right.
- GetChannels is an alias for GetChannel and can be used interchangeably.
The ordering of the channels is determined by the ordering of the input file, because AviSynth doesn't assume any ordering (see Remarks).
In case of WAV files, the ordering should be as follows:
WAV, 2 channels (stereo) 1 left 2 right WAV, 5.1 channels 1 front left 2 front right 3 front center 4 LFE (Low Frequency Enhancement; Subwoofer) 5 rear left 6 rear right
Every file format has a different internal channel ordering. The following table gives this internal ordering for some formats (useful for plugin writers), but it is the decoder's task to return the expected channel order. If you use decoders like NicAudio/BassAudio or ffdshow/AC3Filter you don't need to worry about this.
Format Channel 1 Channel 2 Channel 3 Channel 4 Channel 5 Channel 6 5.1 WAV front left front right front center LFE rear left rear right 5.1 AC3 front left front center front right rear left rear right LFE 5.1 DTS ¹ front center front left front right rear left rear right LFE 5.1 AAC ² front center front left front right rear left rear right LFE 5.1 AIFF front left rear left front center front right rear right LFE 5.1 FLAC front left front right front center LFE rear left rear right 5.1 WMA front left front right front center LFE rear left rear right
¹ 5.1 DTS: the LFE is on a separate stream (much like on multichannel MPEG2).
² There is no free version of the AAC specification available online.
- Remove right channel information, and return as mono clip with only left channel:
- Do the same, alternate syntax:
- You could also obtain the channels from the AVI file itself:
- Convert AVI with 5.1 audio to a stereo signal
(But see below for channel ordering, and here for more complex downmix functions.)
- Convert AVI with "uncompressed 5.1 wav" audio to a stereo signal:
- Mix 5.1 AC3 to stereo - see discussion here.