Copyright © 2011-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.

 

During the execution of the editing session the CallbackEditPerc delegate is invoked in order to notify about the percentage of advancement.

 

For further details about callback delegates see the How to synchronize the container application with the API tutorial.

For further details about methods related to the use of special effects refer to the EffectsMan class.

 

 

Syntax

 

[Visual Basic]

Public Function ChannelsRemapApply (

mapChans as Int32,

nChannelsToMap as Int16

) as enumErrorCodes


 

[C#]

public enumErrorCodes ChannelsRemapApply (

enumRemapChannels[] mapChans,

Int16 nChannelsToMap

);


 

[C++]

public: enumErrorCodes ChannelsRemapApply (

enumRemapChannels __gc[] mapChans,

Int16 nChannelsToMap

);


 

 

Parameter

Description

 

 

nPlayerIndex

Number representing the zero-based index of the involved player

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

 

' define the map of channels

Dim mapChannels As enumRemapChannels() = New enumRemapChannels(2){}

mapChannels(0) = enumRemapChannels.REMAP_CHANNEL_1

mapChannels(1) = enumRemapChannels.REMAP_CHANNEL_0

 

' apply the new map

m_audioSoundEditorApi.Effects.ChannelsRemapApply (mapChannels, 2)

 

 

C#

 

// define the map of channels

enumRemapChannels[] mapChannels = new enumRemapChannels[2];

mapChannels[0] = enumRemapChannels.REMAP_CHANNEL_1;

mapChannels[1] = enumRemapChannels.REMAP_CHANNEL_0;

 

// apply the new map

m_audioSoundEditorApi.Effects.ChannelsRemapApply (mapChannels, 2);

 

 

Mixing of left and right stereo channels:

 

Visual Basic

 

' define the map of channels

Dim mapChannels As enumRemapChannels() = New enumRemapChannels(2){}

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

m_audioSoundEditorApi.Effects.ChannelsRemapApply (mapChannels, 2)

 

 

C#

 

// define the map of channels

enumRemapChannels[] mapChannels = new enumRemapChannels[2];

mapChannels[0] = enumRemapChannels.REMAP_CHANNEL_0 | enumRemapChannels.REMAP_CHANNEL_1;

mapChannels[1] = enumRemapChannels.REMAP_CHANNEL_0 | enumRemapChannels.REMAP_CHANNEL_1;

 

// apply the new map

m_audioSoundEditorApi.Effects.ChannelsRemapApply (mapChannels, 2);

 

 

Muting of left channel:

 

Visual Basic

 

' define the map of channels

Dim mapChannels As enumRemapChannels() = New enumRemapChannels(2){}

mapChannels(0) = enumRemapChannels.REMAP_CHANNEL_SILENT

mapChannels(1) = enumRemapChannels.REMAP_CHANNEL_1

 

' apply the new map

m_audioSoundEditorApi.Effects.ChannelsRemapApply (mapChannels, 2)

 

 

C#

 

// define the map of channels

enumRemapChannels[] mapChannels = new enumRemapChannels[2];

mapChannels[0] = enumRemapChannels.REMAP_CHANNEL_SILENT;

mapChannels[1] = enumRemapChannels.REMAP_CHANNEL_1;

 

// apply the new map

m_audioSoundEditorApi.Effects.ChannelsRemapApply (mapChannels, 2);

 

 

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

 

Visual Basic

 

' define the map of channels

Dim mapChannels As enumRemapChannels() = New enumRemapChannels(4){}

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

m_audioSoundEditorApi.Effects.ChannelsRemapApply (mapChannels, 4)

 

 

C#

 

// define the map of channels

enumRemapChannels[] mapChannels = new enumRemapChannels[4];

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

audioDjStudio1.Effects.ChannelsRemapApply (mapChannels, 4);

 

 

 

Return value

 

Value

Meaning

 

 

Negative value

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

enumErrorCodes.NOERROR (0)

The method call was successful.