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

Author Topic: alGenSources fails after creating a bunch of sf::Sounds  (Read 25604 times)

0 Members and 1 Guest are viewing this topic.

nitram_cero

  • Full Member
  • ***
  • Posts: 166
    • View Profile
alGenSources fails after creating a bunch of sf::Sounds
« on: December 31, 2008, 09:12:44 pm »
alGenSources fails after creating 62 sounds in my case.

Apparently OpenAL has a limit on sources, so the relation of 1 sf::Sound to 1 OpenAL-source is not very useful.

Please read this:
http://www.gamedev.net/community/forums/topic.asp?topic_id=102469

Any insight on this? Can OpenAL software-mix sounds as SDL_mixer does when putting them in a channel?

EDIT:
I'm using the OpenAL32.dll included in the SFML sdk and it works now.
I was using before the official OpenAL to solve an SFML 1.3 bug, but with SVN-950 it's solved now, and I've come back to it.
Geez, I hate this incompatible library stuff... only gives headaches.

Thanks
-Martín
And happy new year!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
alGenSources fails after creating a bunch of sf::Sounds
« Reply #1 on: January 01, 2009, 12:06:10 pm »
Anyway, you should never have to create 62 sounds at the same time, just re-use inactive sounds which are already allocated (I assume you don't play those 62 sounds at the same time).
Laurent Gomila - SFML developer

nitram_cero

  • Full Member
  • ***
  • Posts: 166
    • View Profile
alGenSources fails after creating a bunch of sf::Sounds
« Reply #2 on: May 07, 2009, 07:51:51 pm »
I don't think that's a good solution. 62 sounds is an awful low value for sound rich applications.

I don't use them but I could. Actually , those sounds where to be played when several different objects collided between themselves or the world. Boxes, tin cans, etc.

And I use one sf::Sound per Object.

Having to reimplement a queue to recycle sounds really beats the point of having a Sound object at all.

And also, 62 where my audio card max. But some cards only have up to 16 channels. An action game is most likely to have more than that number of consecutive sounds (Shots, enemy screams, hit sounds, explosions...).

You should point this out somewhere in the documentation, so library users send the SFML-SDK's OpenAL DLL with their software to aviod problems.

-Martín

K-Bal

  • Full Member
  • ***
  • Posts: 104
    • View Profile
    • pencilcase.bandcamp.com
    • Email
alGenSources fails after creating a bunch of sf::Sounds
« Reply #3 on: May 08, 2009, 12:05:33 am »
I would implement a SoundManager class that you can just use like this:

Code: [Select]


std::string filename = "somesound.wav";

SoundManager.playSound(filename);



If the file was already loaded, the manager just stops the current instance and plays it again from the beginning. This is how I use sounds in my projects and it works for my needs ;)
Listen to my band: pencilcase.bandcamp.com

nitram_cero

  • Full Member
  • ***
  • Posts: 166
    • View Profile
alGenSources fails after creating a bunch of sf::Sounds
« Reply #4 on: May 08, 2009, 04:33:41 pm »
Thanks, but that doesn't work for me.

Example: If you have two players charging the same type of weapon in different moments (shwoooooooooooooon TI TI TI) , then only one sound would be played. And the ready parte "TI TI TI" will only sound for the later charged.

With spatialization is even worst, as the sources come from different places.

I understand there is a limited amount of hardware accelerated channels, for that I use the software-OpenAL driver that downmixes everything by software to one channel (maximum compatibility).

Regards
-Martín

DustinBechler

  • Newbie
  • *
  • Posts: 1
    • View Profile
alGenSources fails after creating a bunch of sf::Sounds
« Reply #5 on: October 04, 2010, 01:55:08 pm »
Nitram is openal still worth using? I understand that it would speed things up a lot.
You could ever consider private salehoo review and / or maybe perfect uninstaller to refurbish your laptop or computer and also for dinner you may health and well being gaze at truth about six pack abs and also for increased traffic look through a top seo tips very quickly.

Spellbreaker

  • Newbie
  • *
  • Posts: 33
    • ICQ Messenger - 287156171
    • MSN Messenger - spellbreaker@live.de
    • Yahoo Instant Messenger - Spellbreaker1979
    • View Profile
    • http://www.apeironstudios.com
alGenSources fails after creating a bunch of sf::Sounds
« Reply #6 on: October 05, 2010, 11:15:09 am »
PLease don't dig up 1 year old threads for such questions. Use PM or start a new thread.