0
0

Hi,

Using Fmod for the first time, I get an error :
[b:20bq0g8k]FMOD error! (44) Not enough memory or resources.[/b:20bq0g8k]

This is my code :

[code:20bq0g8k]
int main()
{
FMOD::System *system;
FMOD_RESULT result;
unsigned int version;
int numdrivers;
FMOD_SPEAKERMODE speakermode;
FMOD_CAPS caps;
char name[256];

/*
    Create a System object and initialize.
*/
result = FMOD::System_Create(&system);
ERRCHECK(result);

result = system->init(100, FMOD_INIT_NORMAL, 0);
ERRCHECK(result);

FMOD::Sound* sound = NULL;
result = system->createSound("D:/My Music/Jay-Z & Linkin Park - Numb - Encore.mp3",FMOD_DEFAULT, NULL, &sound);
ERRCHECK(result);


do
{

result = system->playSound(FMOD_CHANNEL_FREE, sound, false, NULL);
ERRCHECK(result);
    system->update();

}while(true);

}

[/code:20bq0g8k]

Any idea of the problem ?

Thanks a lot.

Ange_blond.

  • You must to post comments
0
0

Just looking at your code I can see your while loop will spin really fast playing the sound on a new channel each time (so lots and lots of channels).

You probably want to restructure that code to store the channel returned as the last parameter of playSound and then use channel->isPlaying() to check for when it has finished.

  • You must to post comments
0
0

Hi mathew

I put a loop copy/pasting the examples, but before that I was just doing :

[code:2w3j13ee]result = system->playSound(FMOD_CHANNEL_FREE, sound, false, NULL);[/code:2w3j13ee]

The error was already there…

Any idea or suggestion of how I can just play a sound ?

(like a Hello Word for FMod playing sound)

Thanks.

  • You must to post comments
0
0

Check out the examples folder that comes with the src. There’s lots of good stuff there.

  • You must to post comments
0
0

Yes, I would recommend working with the playsound example, it’s the closest we have to a "hello world". Start with modifying that until you are comfortable with building from scratch.

Also note it’s worth using FMOD_SOFTWARE as a flag in your createSound call, it will remove anyway weird driver issues you may be having.

  • You must to post comments
0
0

[quote="mathew":jnfo00wo]
Also note it’s worth using FMOD_SOFTWARE as a flag in your createSound call, it will remove anyway weird driver issues you may be having.[/quote:jnfo00wo]

Year :-)

FMOD_SOTFWARE made the difference !

Thanks a lot 😉

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.