The basic issue is that I want to call SetPosition to start an event playing from somewhere other than the start. I’m using the FMOD Designer API, version 4.6.20.
So here’s a snippet of code that I hope explains it better:
int numChannels = 0;
ms_system->getChannelsPlaying( &numChannels );
// numChannels contains 14 at this point.
m_event->getInfo( NULL, NULL, &info );
numChannels = info.channelsplaying;
// Where m_event is an FMOD::Event* setup earlier. numChannels set to 2 at this point, so all okay so far.
FMOD::ChannelGroup* pChannelGroup = 0;
FMOD::Channel* pChannel = 0;
FMOD::EventCategory *pCategory = 0;
m_event->getCategory( &pCategory );
pCategory->getChannelGroup( &pChannelGroup );
pChannelGroup->getNumChannels( &numChannels ) );
// numChannels set to 0 at this point! Why not 2? So the loop below does nothing
for( int channelCounter = numChannels -1 ; channelCounter >= 0; –channelCounter )
pChannelGroup->getChannel ( channelCounter, &pChannel );
pChannel->setPosition( intPosition, FMOD_TIMEUNIT_SENTENCE_MS );
I’ve also tried setting the event’s ChannelGroup via ms_system->createChannelGroup( 0, &m_channelgroup ) and calling getNumChannels on that, but that also returns 0.
Grateful for any help. Thanks.
- glowkeeper asked 10 years ago
- You must login to post comments