Copyright © 2008-2018 MultiMedia Soft

Effects.ChannelsRemapApply method

Previous pageReturn to chapter overviewNext page

Remarks

 

Applies a remapping or swapping or mixing of audio channels of the loaded sound.

 

A successful call to this method will fire the SoundEditStarted event followed by a number of SoundEditPerc events and finally by the SoundEditDone event.

 

For further details about methods related to the use of special effects refer to the Effects COM object.

 

 

Syntax

 

[Visual Basic]

control.Effects.ChannelsRemapApply (

mapChans as Long,

nChannelsToMap as Integer

) as enumErrorCodes


 

[C++]

short control.Effects.ChannelsRemapApply (

long *mapChans,

short nChannelsToMap

);


 

 

 

Parameter

Description

 

 

mapChans

The map of available channels, can be a combination of the following values:

Mnemonic constant

Value

Meaning

REMAP_CHANNEL_SILENT

0

Silence the channel

REMAP_CHANNEL_0

1 (0x01)

Channel 0 or left channel

REMAP_CHANNEL_1

2 (0x02)

Channel 1 or right channel

REMAP_CHANNEL_2

4 (0x04)

Channel 2

REMAP_CHANNEL_3

8 (0x08)

Channel 3

REMAP_CHANNEL_4

16 (0x10)

Channel 4

REMAP_CHANNEL_5

32 (0x20)

Channel 5

REMAP_CHANNEL_6

64 (0x40)

Channel 6

REMAP_CHANNEL_7

128 (0x80)

Channel 7

nChannelsToMap

Number of channels covered by the map.

 

Multi-channel order of each channel is as follows:

 

3 channels           left-front, right-front, center.
4 channels           left-front, right-front, left-rear/side, right-rear/side.
5 channels           left-front, right-front, center, left-rear/side, right-rear/side.
6 channels (5.1)   left-front, right-front, center, LFE, left-rear/side, right-rear/side.
8 channels (7.1)   left-front, right-front, center, LFE, left-rear/side, right-rear/side, left-rear center, right-rear center.

 

The following snippets show some possible combination.

 

Swapping of left and right stereo channels:

 

Visual Basic 6

 

' define the map of channels

Dim mapChannels(2) As Long

mapChannels(0) = enumRemapChannels.REMAP_CHANNEL_1

mapChannels(1) = enumRemapChannels.REMAP_CHANNEL_0

 

' apply the new map

AudioSoundEditor1.Effects.ChannelsRemapApply VarPtr(mapChannels(0)), 2

 

 

Visual C++

 

// define the map of channels

long mapChannels[2];

mapChannels[0] = REMAP_CHANNEL_1;

mapChannels[1] = REMAP_CHANNEL_0;

 

// apply the new map

AudioSoundEditor1.GetEffects().ChannelsRemapApply (mapChannels, 2);

 

 

Mixing of left and right stereo channels:

 

Visual Basic 6

 

' define the map of channels

Dim mapChannels(2) As Long

mapChannels(0) = enumRemapChannels.REMAP_CHANNEL_0 Or enumRemapChannels.REMAP_CHANNEL_1

mapChannels(1) = enumRemapChannels.REMAP_CHANNEL_0 Or enumRemapChannels.REMAP_CHANNEL_1

 

' apply the new map

AudioSoundEditor1.Effects.ChannelsRemapApply VarPtr(mapChannels(0)), 2

 

 

Visual C++

 

// define the map of channels

long mapChannels[2];

mapChannels[0] = REMAP_CHANNEL_0 | REMAP_CHANNEL_1;

mapChannels[1] = REMAP_CHANNEL_0 | REMAP_CHANNEL_1;

 

// apply the new map

AudioSoundEditor1.GetEffects().ChannelsRemapApply (mapChannels, 2);

 

 

Muting of left channel:

 

Visual Basic 6

 

' define the map of channels

Dim mapChannels(2) As Long

mapChannels(0) = enumRemapChannels.REMAP_CHANNEL_SILENT

mapChannels(1) = enumRemapChannels.REMAP_CHANNEL_1

 

' apply the new map

AudioSoundEditor1.Effects.ChannelsRemapApply VarPtr(mapChannels(0)), 2

 

 

Visual C++

 

// define the map of channels

long mapChannels[2];

mapChannels[0] = REMAP_CHANNEL_SILENT;

mapChannels[1] = REMAP_CHANNEL_1;

 

// apply the new map

AudioSoundEditor1.GetEffects().ChannelsRemapApply (mapChannels, 2);

 

 

Swapping of front and rear channels on a 4 channels song:

 

Visual Basic 6

 

' define the map of channels

Dim mapChannels(4) As Long

mapChannels(0) = enumRemapChannels.REMAP_CHANNEL_2

mapChannels(1) = enumRemapChannels.REMAP_CHANNEL_3

mapChannels(2) = enumRemapChannels.REMAP_CHANNEL_0

mapChannels(3) = enumRemapChannels.REMAP_CHANNEL_1

 

' apply the new map

AudioSoundEditor1.Effects.ChannelsRemapApply VarPtr(mapChannels(0)), 4

 

 

Visual C++

 

// define the map of channels

long mapChannels[4];

mapChannels[0] = REMAP_CHANNEL_2;

mapChannels[1] = REMAP_CHANNEL_3;

mapChannels[2] = REMAP_CHANNEL_0;

mapChannels[3] = REMAP_CHANNEL_1;

 

// apply the new map

AudioSoundEditor1.GetEffects().ChannelsRemapApply (mapChannels, 4);

 

 

 

Return value

 

Value

Meaning

 

 

Negative value

An error occurred (see the LastError property for further error details)

enumErrorCodes.ERR_NOERROR (0)

The call was successful.