0
0

If I call ChannelGroup::setMute, I expect to mute all sound and music. But, when I call System::createSteam or System::createSound, then FMOD Ex work to play sound and original volume. Is this not bug?

  • You must to post comments
0
0

I was having the same problem. I found that if I explicitly assigned a channel to the master group after playing a sound, the muting behavior worked as I expected (i.e. the sound would be muted if the master channel was muted).

This is what that looks like:

FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound, FALSE, &channel);
FMOD_Channel_SetChannelGroup(channel, masterGroup);

I don’t know if this is the expected behavior and I’m misunderstanding the API, or if this is a bug. The strange thing is that if I get the channel group for the channel after playing the sound, it says that it’s the master channel group.

  • You must to post comments
0
0

I’m not entirely sure I get what you mean, but let me give it a shot.

ChannelGroup::setMute() mutes all the channels in this particular Channel Group. Any channels active outside this Channel Group will not be affected. So if you have a Channel Group containing ALL the channels in your program, then yes, it should mute ALL the sounds.

Can you be more specific about your problem if this didn’t answer your question? :)

  • You must to post comments
0
0

I’m not sure I understand. It says it belongs to the master channelgroup because thats the channelgroup it belongs to by default, and also the one you just set it to in your example code?

What is the code you were trying to do that didn’t work? And was it using an up to date FMOD version?

  • You must to post comments
0
0

[quote="Hong SungBock":s75s355c]If I call ChannelGroup::setMute, I expect to mute all sound and music. But, when I call System::createSteam or System::createSound, then FMOD Ex work to play sound and original volume. Is this not bug?[/quote:s75s355c]
It’s not as intuitive as it seems unfortunately. :(

Most of the ChannelGroup functions just iterate through the channels assigned to the group and make the desired modifications one time. They don’t "mark" the ChannelGroup or put it into a certain state.

So when you call ChannelGroup::setMute() it will iterate through and mute all the existing channels, but once you add another channel it will play normally until you either mute that channel manually or call setMute() on the ChannelGroup again.

  • You must to post comments
0
0

Yes, it should belong to the master channel group, but it doesn’t behave that way unless I explicitly set the channel group after playing a sound on it.

I’m using the latest version of FMOD Ex. I can send you an example that demonstrates the behavior if that would help.

  • You must to post comments
0
0

[quote="Dogbert":gbzsvx40][quote="Hong SungBock":gbzsvx40]If I call ChannelGroup::setMute, I expect to mute all sound and music. But, when I call System::createSteam or System::createSound, then FMOD Ex work to play sound and original volume. Is this not bug?[/quote:gbzsvx40]
It’s not as intuitive as it seems unfortunately. :(

Most of the ChannelGroup functions just iterate through the channels assigned to the group and make the desired modifications one time. They don’t "mark" the ChannelGroup or put it into a certain state.

So when you call ChannelGroup::setMute() it will iterate through and mute all the existing channels, but once you add another channel it will play normally until you either mute that channel manually or call setMute() on the ChannelGroup again.[/quote:gbzsvx40]

Odd. All My sounds start mute if I mute either the group or one of the parent group of the channel… Or the main "system" group.

Though I do intanciate channels paused, set the group then unpause the channel.

  • You must to post comments
0
0

Here’s a modified version of the channel groups example that demonstrates what I’m talking about.

To see the issue, run the example and press ‘A’. That will mute the master channel. The sound should continue to play though. Pressing ‘B’ will cause the channel to be explicitly assigned to the master group and should cause the sound to be muted correctly.

[code:2vg6lp0c]#include <windows.h>

include <stdio.h>

include <conio.h>

include "../../api/inc/fmod.hpp"

include "../../api/inc/fmod_errors.h"

void ERRCHECK(FMOD_RESULT result)
{
if (result != FMOD_OK)
{
printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result));
exit(-1);
}
}

int main(int argc, char *argv[])
{
FMOD::System *system;
FMOD::Sound *sound;
FMOD::Channel *channel[1];
FMOD::ChannelGroup *masterGroup;
FMOD_RESULT result;
int key, count;
unsigned int version;

result = FMOD::System_Create(&amp;system);
ERRCHECK(result);

result = system-&gt;getVersion(&amp;version);
ERRCHECK(result);

if (version &lt; FMOD_VERSION)
{
    printf(&quot;Error!  You are using an old version of FMOD %08x.  This program requires %08x\n&quot;, version, FMOD_VERSION);
    return 0;
}

result = system-&gt;init(32, FMOD_INIT_NORMAL, 0);
ERRCHECK(result);

result = system-&gt;createSound(&quot;../media/jaguar.wav&quot;,  FMOD_DEFAULT, 0, &amp;sound);
ERRCHECK(result);

result = system-&gt;getMasterChannelGroup(&amp;masterGroup);
ERRCHECK(result);

bool mute = false;
bool workAround = false;

printf(&quot;Press A to toggle muting sound\n&quot;);
printf(&quot;Press B to toggle mute workaround\n&quot;);

do
{
    if (kbhit())
    {
        key = getch();

        switch (key)
        {
        case 'a' : 
        case 'A' : 
            mute = !mute;
            masterGroup-&gt;setMute(mute);
            break;
        case 'b' : 
        case 'B' : 
            workAround = !workAround;
            break;
        }
    }

    // Start a sound if there isn't one playing.

    int channelsplaying = 0;
    system-&gt;getChannelsPlaying(&amp;channelsplaying);

    if (channelsplaying == 0)
    {

        FMOD::Channel* channel = NULL;

        result = system-&gt;playSound(FMOD_CHANNEL_FREE, sound, true, &amp;channel);
        ERRCHECK(result);

        if (workAround)
        {
            result = channel-&gt;setChannelGroup(masterGroup);
            ERRCHECK(result);
        }

        result = channel-&gt;setPaused(false);
        ERRCHECK(result);            

    }

    system-&gt;update();

    if (mute)
    {
        printf(&quot;Sound is muted %s\r&quot;, workAround ? &quot;with workaround&quot; : &quot;&quot;);
    }

    Sleep(10);

} while (key != 27);

printf(&quot;\n&quot;);

result = sound-&gt;release();
ERRCHECK(result);

result = system-&gt;close();
ERRCHECK(result);
result = system-&gt;release();
ERRCHECK(result);

return 0;

}[/code:2vg6lp0c]

  • You must to post comments
0
0

[quote="Dogbert":1t5xh4bi][quote="Hong SungBock":1t5xh4bi]If I call ChannelGroup::setMute, I expect to mute all sound and music. But, when I call System::createSteam or System::createSound, then FMOD Ex work to play sound and original volume. Is this not bug?[/quote:1t5xh4bi]
It’s not as intuitive as it seems unfortunately. :(

Most of the ChannelGroup functions just iterate through the channels assigned to the group and make the desired modifications one time. They don’t "mark" the ChannelGroup or put it into a certain state.

So when you call ChannelGroup::setMute() it will iterate through and mute all the existing channels, but once you add another channel it will play normally until you either mute that channel manually or call setMute() on the ChannelGroup again.[/quote:1t5xh4bi]

This is incorrect. It does not ‘just interate through’, it respects the mute/pause status of the channelgroup and the channelgroup’s parents/grandparents/etc as soon as it belongs to that channelgroup.

You do not have to do any extra ‘work’ to make it behave correctly, you just set the channelgroup state once and that’s it.

  • You must to post comments
0
0

[quote="icuurd12b42":2h513p0z][quote="Dogbert":2h513p0z][quote="Hong SungBock":2h513p0z]If I call ChannelGroup::setMute, I expect to mute all sound and music. But, when I call System::createSteam or System::createSound, then FMOD Ex work to play sound and original volume. Is this not bug?[/quote:2h513p0z]
It’s not as intuitive as it seems unfortunately. :(

Most of the ChannelGroup functions just iterate through the channels assigned to the group and make the desired modifications one time. They don’t "mark" the ChannelGroup or put it into a certain state.

So when you call ChannelGroup::setMute() it will iterate through and mute all the existing channels, but once you add another channel it will play normally until you either mute that channel manually or call setMute() on the ChannelGroup again.[/quote:2h513p0z]

Odd. All My sounds start mute if I mute either the group or one of the parent group of the channel… Or the main "system" group.

Though I do intanciate channels paused, set the group then unpause the channel.[/quote:2h513p0z]

It is working as you expect because that’s because it is the way it is supposed to work. The initial comment was misleading that’s all.

  • You must to post comments
0
0

Apologies, I must have been thinking of something else.

Ah, looks like I was thinking of ChannelGroup::overrideSpeakerMix(), my bad.

  • You must to post comments
0
0

[quote="Hong SungBock":mlk88jem]If I call ChannelGroup::setMute, I expect to mute all sound and music. But, when I call System::createSteam or System::createSound, then FMOD Ex work to play sound and original volume. Is this not bug?[/quote:mlk88jem]
So you’re saying that the sound is not muted, even though you added the new Channel to the ChannelGroup you called setMute() on?

  • You must to post comments
0
0

A long time ago (many versions ago), I hit a tiny snag, fiddly with the master settings, pause, mute, pan and other things woul not affect my sounds…

The problem was that the group the sound was in was not a member of the main system group as I had assumed from reading the documentation.

Is that what going on for you?

I realised I had to manually add my new groups to the master group and everything worked from then on.

  • You must to post comments
0
0

I did call ChannelGroup::setMute of master channel group in FMOD Ex. Then all sound mute immdiatly. However, later the sound that load from hard disk get play without ‘MUTE’. FMOD Ex samples has this problem, too.

  • You must to post comments
0
0

FMOD Ex examples do not have this problem. Are you using a really old version of fmod or something? There were issues with this about 6 months ago. No new versions have this issue.

Just use a current version, look at the ‘channelgroups’ example, and put

[code:s0hx2prj]
result = masterGroup->setMute(true);
ERRCHECK(result);

/*
    Start all the sounds!
*/

[/code:s0hx2prj]

to mute the master channelgroup before it starts the sounds. No sound plays at all.

Muting or pausing a channelgroup will mean any sound started in this group will be muted or paused. They do not ignore this fact.

  • You must to post comments
Showing 14 results
Your Answer

Please first to submit.