0
0

Hows it going. I ran into a problem modifing the sound on multiple channels. Heres the pseduo code for what I am doing

I am using visual studio 2003 and i am writting in C++

Game Init()
{
-I do the standard system create and init stuff
-after that i set up the channel groups

result = system->createChannelGroup("Group A", &groupA);
result = system->createChannelGroup("Group B", &groupB);

result = system->getMasterChannelGroup(&masterGroup);

result = masterGroup->addGroup(groupA);
result = masterGroup->addGroup(groupB);

}

Game Main()
{
–Playing 4 minute background sound looping(channel 1)
–when your switching through the menu a quick less then a second click happens(channel 2)

    result = channel->setChannelGroup(groupA);
result = channel2->setChannelGroup(groupB);

   if (m_pDI->GetBufferedKey(DIK_G))
{
    float volume;
    result = groupA->getVolume(&volume);
    volume += 0.1f;
    result = groupA->setVolume(volume);
}
else if (m_pDI->GetBufferedKey(DIK_B))
{
    float volume;
    result = groupA->getVolume(&volume);
    volume -= 0.1f;
    result = groupA->setVolume(volume);
}
else if (m_pDI->GetBufferedKey(DIK_E))
{
    float volume;
    result = groupB->getVolume(&volume);
    volume += 0.1f;
    result = groupB->setVolume(volume);
}
else if (m_pDI->GetBufferedKey(DIK_D))
{
    float volume;
    result = groupB->getVolume(&volume);
    volume -= 0.1f;
    result = groupB->setVolume(volume);
}

system->update();

}

My problem is that I am able to change the volume on channel one but channel two is not working out. Channel one is the only channel in groupA and channel2 is the only channel in groupB.
"result = channel2->setChannelGroup(groupB);" is returning a FMOD_ERR_INVALID_HANDLE message while doing that for channel 1 is returning FMOD ok…. can anyone explain to me why…

Thanks a lot guys and I would definatly appreciate any suggestions ASAP

  • You must to post comments
0
0

I was able to get my "MasterGroup" to modify the volume on GroupB but… i still cant modify the groupB individually…

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.