Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Array of sounds not working  (Read 3650 times)

0 Members and 1 Guest are viewing this topic.

jeremyspk

  • Newbie
  • *
  • Posts: 26
    • View Profile
Array of sounds not working
« 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Array of sounds not working
« Reply #1 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?
Laurent Gomila - SFML developer

jeremyspk

  • Newbie
  • *
  • Posts: 26
    • View Profile
Array of sounds not working
« Reply #2 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. :)