0
0

I’ve got a member function something like this

FMOD_RESULT Musicplayer::PlayTrack(FMOD::Channel* chan)
{
chan->isPlaying(&m_isplaying);
if (!m_isplaying)
{
result = AudioSystem::GetInstance()->mpSoundSystem->playSound(FMOD_CHANNEL_REUSE, m_sound, false, &chan);
result = AudioSystem::GetInstance()->mpSoundSystem->createChannelGroup("music", &m_channelgroup);
MY_ASSERT(result == FMOD_OK,"FMOD Could not create a Channel Groupo! \n");
result = chan->setChannelGroup(m_channelgroup);
MY_ASSERT(result == FMOD_OK,"FMOD Could not assign the Music Channel! \n");
result = m_channelgroup->addDSP(dsplowpass);
MY_ASSERT(result == FMOD_OK,"FMOD Could not assign DSP to this Channel! \n");
}
return result;
}

This seems to work fine with a single channel but I’m trying to call it using an array of channels, I was using an array because I want to crossfade 2 music streams using setVolume for each channel. Is there a simpler way to do it or am I missing something blatantly obvious?

  • You must to post comments
0
0

if you’re calling that function for more than 1 track, wouldnt you just be creating multiple channel groups? You could create one at the start (along with the dsp), then just call setChannelGroup when you play each new track.

  • You must to post comments
0
0

I think I realized the obvious bit, I should have been specifying the channel index instead of using the priority system. I just use chan 0 and 1. One other thought, does Channel::stop remove a channel from the channel group? I don’t see any example code using channel groups.(seelazy engineer should write his own damn test app ) 😀

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.