0
0

hi,

i have a problem with a channel group which contains all fx sounds. the effect is that the fx sounds seem to lose their group affiliation so changing the channel groups’s volume does not affect the included sound volumes.

it may be that i have done some bad things in code. before i provide some code snippets i just wanted to ask some general questions about channels groups:

  1. is it ok to create a channel group and store its pointer for later usage? ( in order to append the fx sounds to it, it is. )

  2. can it happen that the channel group is changed by fmod system internally? i ask as i have appended some fx sounds to a created channel group and later if i check the pointer by calling getChannelGroup on their channels then i get a different pointer than that one i used to group them. i check the group name and get "FMOD master group". indeed, the actually used groups are all attached to the fmod master group. but how have the sounds been moved to the master group instead of keeping in the fx group?

  3. does stopping, pausing, and starting a sound affect the group affiliation? i do not release the sounds, i just stop them or pause them sometimes.

btw: i use also a channel group for background sound and gui stuff, that group seems to work well i.r.t. setting the group volume.

any help would be nice.

cheers
boto

  • You must to post comments
0
0

hi brett,

[quote:4qqm9u7u]When a channel finishes, it will be reassigned back to the master group, but that doesnt matter anyway because the sound has ended and you can’t use the channel any more anyway (you will just get FMOD_ERR_INVALID_HANDLE).
Every time you play a sound on a channel it gets a new channel, so the channel has to be put into a channelgroup when you play it.
[/quote:4qqm9u7u]

hmmm, i thought if i REUSE an existing channel on playing then the channel would keep its group affilication. i had missed the point that channels are shared between sounds for providing virtually many channels so it makes sense to reset them to the master group when they are finished ๐Ÿ˜‰

i have modified the code and added a re-grouping everytime when a sound is played and now everthing works fine. thank you for your help :-)

cheers
boto

p.s.: for those of you interested in our fmod-based sound manager take a look here:

http://svn.berlios.de/viewcvs/yag2002/t … dmanager.h
http://svn.berlios.de/viewcvs/yag2002/t … anager.cpp

  • You must to post comments
0
0

Opps, sorry, wrong button ๐Ÿ˜‰

  • You must to post comments
0
0

[quote="boto":2a89mgik]
[quote="brett":2a89mgik]3. does stopping, pausing, and starting a sound affect the group affiliation? i do not release the sounds, i just stop them or pause them sometimes.
[/quote:2a89mgik]
Pausing doesnt, stopping does, as i said.[/quote:2a89mgik]

How about Mute?, does that affect the used channel ?

When I call a function to mute all playing channels within a ChannelGroup (like this)

[code:2a89mgik] for( int i=0; i < (int)m_VCachedSoundFiles.size(); i++ )
{
if(m_VCachedSoundFiles[i]->GetGroupID() == SOUND_GROUP)
{
if(m_VCachedSoundFiles[i]->GetActive())
{
m_VCachedSoundFiles[i]->SetActive(FALSE);
result = m_VCachedSoundFiles[i]->GetFMOD_Channel()->setMute(TRUE);
ErrorCheck(result);
}
}
}[/code:2a89mgik]
This works perfectly, but if I later in the game call for unMute of all sounds in the ChannelGroup
with this code:
[code:2a89mgik] for( int i=0; i < (int)m_VCachedSoundFiles.size(); i++ )
{
if(m_VCachedSoundFiles[i]->GetGroupID() == SOUND_GROUP)
{
if(!m_VCachedSoundFiles[i]->GetActive())
{
m_VCachedSoundFiles[i]->SetActive(TRUE);
result = m_VCachedSoundFiles[i]->GetFMOD_Channel()->setMute(FALSE);
ErrorCheck(result);
}
}
}[/code:2a89mgik]
Then it crashes on Channel::setMute(FALSE), because the Channel points to NULL, why is that?
Is the channel removed when muted? I also tried with Channel::setVolume(0.0f); instead of mute and that only works for the "mute"-part, but when I’m going to "unmute" it, it crashes with "FMOD error! (33) An invalid object handle was used."

GetActive() is my function returning a bool, I set the sound to active when it’s playing a sound, when stopped/muted it is set to false, or is there a built-in function that does that to the Sound/Channel in FMOD?

Any help would be really appreciated

Greetings
Christer

  • You must to post comments
0
0

It’s funny how you call a simple error code a ‘crash’. Ok so it didnt crash ๐Ÿ˜•

If a sound on a channel ends, the channel goes invalid.
You shouldnt be caching handles like this. Just mute the channelgroup.

  • You must to post comments
0
0

Heh, I’m dizzy, of course I should use ChannelGroups and mute it :)
so now it works, thanks :)

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.