0
0

Hello,

I have just started using fmod, I am building a game that will use the musicsystem extensively.

I am wondering if it is possible to get the channels that are in the ‘music’ category. I was able to get a ChannelGroup but it is reporting that there are 0 channels in it and I am unable to retrieve any individual channels.

-Clay

  • You must to post comments
0
0

Hi,

I ‘m new on fmod and i have the same problem…
viewtopic.php?f=7&t=14325

I hope a solution to finish brilliantly this post.
better late than never ๐Ÿ˜‰

thank you in advance

  • You must to post comments
0
0

Are there any groups in that channel group? The channels are probably in subgroups of the music category channelgroup. Why do you need access to the channels?

  • You must to post comments
0
0

Yes, Peter, now that I’ve checked, I do see that there is 1 group within the group, I will dig around in there.

I need access to the channels in order to get timing information, I would like to know the current position in each segment in order to synchronize it with animations. I will also need to get the sound length, if that is possible… If not, I can work around it. Optimally, I would have liked to be able to get all of this information directly from the MusicSystem API along with time signature and bpm.

  • You must to post comments
0
0

It seems that I am unable to use the channels I retrieve in this group. I am simply crawling down the tree of ChannelGroups and looking for channels.

Am I doing something wrong? I receive this message whenever I call a method on the channel I find:

[quote:26gw19ld]ERR_INVALID_HANDLE – An invalid object handle was used.[/quote:26gw19ld]

  • You must to post comments
0
0

I did some tests and you can definitely access the channels that are playing in the music system. The only issue you may encounter is that if a channel ends it will go invalid and you will get that error.

  • You must to post comments
0
0

Hi again Peter,
I have gone through every channelgroup under ‘music’ and under ‘master'(the only eventcategory in our fev) and have only found one channel, which gives me the error…

The music is playing… Is there anything else you can tell me?

  • You must to post comments
0
0

Well it sounds like the channel you’re getting, is going invalid before you use it. It should be valid at the time you get it.

[quote:1pov4dau]Is there anything else you can tell me?[/quote:1pov4dau]
Just to give you a little background:

A FMOD::Channel* is not a pointer it’s a handle. This means it’s effectively just an unsigned int used as an identifier. When it is valid that int corresponds to a real object inside the engine. You cannot get an access violation with channels. For example:
[code:1pov4dau]((FMOD::Channel*)(NULL))->setPaused(true);[/code:1pov4dau]
will just return FMOD_ERR_INVALID_HANDLE.

When you use FMOD::ChannelGroup::getChannel and use an invalid index it will set your channel pointer to NULL. This is another possible cause for your INVALID_HANDLE error.

You mentioned that the music was playing when you were searching for a channel. This is very important, a channel only exists when sound is playing.

For my test I searched all the channel groups to find one with a channel and then called setPaused on that channel and there was no error.

It might be helpful to try calling FMOD::EventSystem::update some of the channel management stuff can happen in there as well.

Let me know how you go. If you’re still stuck, please post the code where you find the channel group.

-Pete

  • You must to post comments
0
0

I’ve got it now. I wish I could tell you what the problem had been but I fixed it last night in a late-night stupor and don’t remember what I did. ๐Ÿ˜€

Thanks Peter, cheers!

  • You must to post comments
Showing 8 results
Your Answer

Please first to submit.