Unable to get SetChannelVolume to work

I am having troubles getting SetChannelVolume to work on my PC.
First I prepare my sound cue and then set up the channel map like so

note: pSoundTask->m_pSoundCue is a valid cue

XACTCHANNELMAPENTRY ChannelMapEntries[] =
{
{ 0, 0, 0.0f },
{ 0, 1, 0.0f }
};
DWORD dwNumEntries = 2;
XACTCHANNELMAP ChannelMap =
{ (XACTCHANNEL)dwNumEntries, ChannelMapEntries };
hRVal = pSoundTask->m_pSoundCue->SetChannelMap( &ChannelMap );
ASSERT( SUCCEEDED( hRVal ) );

then per frame I do the following( I do it once before playing the cue and then once per frame until the cue has stopped)

XACTCHANNELVOLUMEENTRY ChannelVolumeEntries[2];
XACTCHANNELVOLUME ChannelVolume = { 2, ChannelVolumeEntries };

for( DWORD i = 0; i < ChannelVolume.EntryCount; i++ )
{
ChannelVolumeEntriesIdea.EntryIndex = (XACTCHANNEL)i;
ChannelVolumeEntriesIdea.Volume = 0.0f;
}
HRESULT hRVal;
hRVal = pSoundTask->m_pSoundCue->SetChannelVolume( &ChannelVolume );
ASSERT( SUCCEEDED( hRVal ) );


I would expect that I should hear nothing as I am setting the volumes to 0, but instead my cues always play a full volume. I just can't see what I am doing wrong Any ideas

Thanks
Stephen Orr


Answer this question

Unable to get SetChannelVolume to work

  • Shehzad Sheikh

    SetChannelVolume is not currently supported on Windows. The api SetMatrixCoefficients provides equivalent functionality.

  • Unable to get SetChannelVolume to work