SFML community forums

Help => Audio => Topic started by: jeremyspk on March 04, 2010, 09:38:15 am

Title: Array of sounds not working
Post by: jeremyspk on March 04, 2010, 09:38:15 am
Code: [Select]

sf::Sound verses[MAX_LOOPS]; // at the constructor

..
..
Sound sound;
sound.SetBuffer(buffer);
verses[getPos(pEntry->d_name)] = sound;


"An internal OpenAL call failed in soundbuffer.cpp (308) : AL_INVALID_VALUE, a numeric argument is out of range"
I get this error message even though it returns TRUE flag.

HOWEVER,
Code: [Select]

Sound sound;
sound.SetBuffer(buffer);

itself works awesome.

I don't get it, why can't it use in arrays?

Any alternative to this code?

I was using Music object and it works fine. But when it comes to Sound instance, it just throws me this mysterious error. :(
Help needed, thank you guys in advance.
Title: Array of sounds not working
Post by: Laurent on March 04, 2010, 03:58:04 pm
Can you show a complete and minimal code that reproduces this problem, so that I can test it myself?
Title: Array of sounds not working
Post by: jeremyspk on March 08, 2010, 03:11:51 am
Okay solved.
Nothing wrong with SFML audio.

Just that Buffer.LoadFromFile() was done more than once, thus the OpenAL error, nothing wrong with object array. :)