0
0

Hi

Ive just started editting an existing project that uses FMOD and has several event systems arrays.

The problem is when i run this game it is giving me the error of: Cannot play ‘sound’ too many instances already playing.

I am new to FMOD and dont know alot about how it works.

The some sounds are failing regularily and others less often. This is always in a 3D environment with positioned sounds and ambient sounds/music playing.

If anyone has any idea of how i can have all sound instances playing that would be fantastic.

  • You must to post comments
0
0

Hi David, welcome to the forums.

[quote:384kzpp7]Cannot play ‘sound’ too many instances already playing. [/quote:384kzpp7]
That is not an FMOD error message, I would guess that this message is being generated by the project in response to receiving an FMOD error. Possibly FMOD_ERR_EVENT_FAILED or FMOD_ERR_INVALID_HANDLE.

In order to find out what is going on, you should work out if your project is using the Event System or the low level.

if it is using the Event System API:
read [b:384kzpp7]FMOD Event System – Best Practices For Programmers[/b:384kzpp7]
(explination of event instances starts on page 8 )

if it is using the FMOD Ex low level API:
read [b:384kzpp7]fmodex.chm[/b:384kzpp7]
(see "tutorials/Channel management and virtual voices")

Both of these files can be found in the ‘documentation’ directory where you installed FMOD.

Hope this helps,

-Pete

  • You must to post comments
0
0

Hi,

I read over the Event System Doc and i am definately using FMOD Event System.

The FMOD error i am getting is FMOD_ERR_EVENT_FAILED
its being called in the following code segment:

/**********************************************************/
struct SoundGroup
{
char m_Name[32];
std::vector<FMOD::EventGroup*> m_FMODGroups;

SoundGroup(const char* name) {strcpy(m_Name, name);}
SoundGroup() {}

};

SoundGroup m_CommonGroup;

FMOD::Event* SoundEventManager::GetEvent(const char* name, bool infoOnly, bool doNotStore, bool autoStop)
{
FMOD_RESULT result;
FMOD::Event* fmodEvent = NULL;
FMOD_EVENT_MODE mode = FMOD_EVENT_DEFAULT;

for (int i = 0; i &lt; m_CommonGroup.m_FMODGroups.size(); i++)
{
     result = m_CommonGroup.m_FMODGroups[i]-&gt;getEvent(name, mode, &amp;fmodEvent);

     if (result != FMOD_ERR_EVENT_NOTFOUND &amp;&amp; result != FMOD_OK)
PrintError(name, result);      /* Error called here */

     if (fmodEvent)
break;
}

}

/**********************************************************/

From what i can gather the FMOD failed error occurs when it cannot be retrieved. However i do not understand the ‘just failed’ reasoning behind the cause.
That is in the file "fmod_event.h":
FMOD_EVENTPROPERTY_MAX_PLAYBACKS_BEHAVIOR, /* Type : int – 1 = steal oldest, 2 = steal newest, 3 = steal quietest, 4 = just fail, 5 = just fail if quietest. */

Any idea why this is failing sometimes but not always?

  • You must to post comments
0
0

Let N be the ‘max playbacks’ property, when the (N+1)th instance is requested, the system will act according to the ‘max playbacks behaviour’.

example:
max playbacks=6
behaviour=just fail

When you call getEvent 7 times, the first 6 will work but the 7th time you call it it will just fail.

-Pete

  • You must to post comments
0
0

I did a check after the FMOD error is detected and the FMOD_EVENTPROPERTY_MAX_PLAYBACKS and FMOD_EVENTPROPERTY_MAX_PLAYBACKS_BEHAVIOR have values of -858993460 each for fmodEvent variable.

/***********************************************************************************/
int maxPlaybacks;
fmodEvent->getPropertyByIndex(FMOD_EVENTPROPERTY_MAX_PLAYBACKS, &maxPlaybacks, false);
int maxPlaybacksBehavior;
fmodEvent->getPropertyByIndex(FMOD_EVENTPROPERTY_MAX_PLAYBACKS_BEHAVIOR, &maxPlaybacksBehavior, false);

/******* check values of maxPlaybacks and maxPlaybacksBehavior using breakpoints *******/
/***********************************************************************************/

Is this a problem with the fsb file? or where this particular sound is initialized? or something else?

  • You must to post comments
0
0

You need to check the FMOD_RESULT returned from every function call. If an error is returned then you need to handle it.

[code:1bwvfwpa]FMOD_RESULT result = fmodEvent->getPropertyByIndex(FMOD_EVENTPROPERTY_MAX_PLAYBACKS, &maxPlaybacks, false);
Assert(result == FMOD_OK);[/code:1bwvfwpa]

It looks to me like those values you are getting from getProperty are just uninitilized memory.

It can be handy to initialise variables to know values before using them.
[code:1bwvfwpa]int maxPlaybacks = -1;[/code:1bwvfwpa]

-Pete

  • You must to post comments
0
0

Hi
thanks for the advice but changing the values in code just didn’t seem to work.

However i was able to change the number of max playbacks in the FSB/FEV file and that has seemed to fix the problem.

Thanks for your help

  • You must to post comments
Showing 6 results
Your Answer

Please first to submit.