[Openal] Re: [Openal-devel] Intelligent Source Manager
Valery Carpentier
Valery_Carpentier at cle.creative.com
Fri Jun 16 03:09:50 PDT 2006
Hi Stefan,
I moved the thread to the OpenAL mailing list, as it's more relevant there
(the OpenAL Developer mailing list deals with people developing OpenAL, not
people using it)
Source management is indeed a thorny issue.
First of all, I think you should not limit the amount of sources you
create. Create as many sources as you can, 16 is very low, a decent
soundcard should manage at least 32 (our X-Fi has 128 sources, for
example). So do create as many sources as possible on a hardware device
(generic hardware or native device) and set a maximum for the software
device (32 is not unreasonable).Note that in your scheme, you do not have
to limit the number of sources, as your cSoundManager class returns a
source when you query one.
When you want to play more sounds than there are sources available, you
have to define priorities (i.e. which sounds are more important, or have to
be played). One simple scheme is to assign a priority to every buffer and
stop the buffer with the lowest priority when you run out of sources (for
example, if you have to play an explosion, you can stop the another sound
with a lower priority).
You can then expand the scheme to include 3D position and perceived
loudness (a distant sound with low gain can be stopped), or if the sound
has nearly finished playing...
HopeThisHelps...
Valery Carpentier
Technology Evangelist, European Digital Media Relations
[e] valery_carpentier at cle.creative.com
[o] +44 (0) 1784 476 772
[m] +44 (0) 7917 800 309
[w] http://developer.creative.com
[w] http://www.eax.creative.com
Notice
The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this
message by anyone else is unauthorized. If you are not the intended
recipient, any disclosure, copying or distribution of the message, or
any action taken by you in reliance on it, is prohibited and may be
unlawful. If you have received this message in error, please delete it
and contact the sender immediately. Thank you.
openal-devel-bounces at opensource.creative.com wrote on 16/06/2006 09:14:54:
>
> Hello all,
>
> First I have to say, that I am quite new to OpenAL (or Soundprogramming
> anyway), although I did get some things working.
>
> Okay I am trying to develop a game, and like every other game there
should
> be nice soundeffects and backgroundmusic and so on.
>
> I decided using OpenAL, because of portabilty to other platforms.
>
> And now I guess i didn't understand the princip in Soundmanagement right.
>
> A few things I found out trying to program with OpenAL.
>
> I can generate an infinit number of buffers, but a very limited number of
> sources (Hardware depending).
> Okay that shouldnt be a problem. I will reserve like 16 sourcres (should
> work fine on every hardware).
> The princips of creating the device, position the soundeffects, and so
on, I
> did understand and works fine.
>
> So but here my real Problem:
> I will have to classes to Manage my Sounds.
>
> There is one, lets call it cSoundManager. This one will make initialize
> OpenAL (making the context, allocate the 16 sources, ...) and manage the
> sources i created.
>
> Then there will be the cSound class, which loads the Soundeffect and
creates
> a buffer from it, can set the position, pitch, velocity and everything
what
> is possible with OpenAL.
>
> Now everytime the cSound is going to play, it asks the SoundManager for
the
> next Source. The SoundManager will give the next Source where the counter
is
> Standing, no matter if the source is Playing or not. So it will start
with
> source 0, the next sound gets source 1, ... and when reached source 15 it
> will start over with source 0.
>
> Okay now lets say an Object got an looping sound, for example a
helicopter,
> it's sound
> wont last very long, because its source will be overwritten quite soon
and
> such things shouldnt really happen.
> A solution could be let the Soundmanager do a playing check on the
sources
> and only give the next "not Playing" source to the cSound, but what will
> happen then when there are 16 looping helicopters around, there wont be
> generated any sound anymore because all sources are used.... And here is
my
> big Problem,... how do you manage such things. Is it okay for you not to
get
> any Soundeffects anymore when there r playing too many at the same time?
Or
> do you just overwrite them? I have no Idea really, It is my first time I
do
> develop an own Soundengine, and I got a big lack of experience here.
>
> I thank you all for your advices in advance
> And whish ya all a nice weekend.
>
> Greetings Stefan
> --
> View this message in context: http://www.nabble.com/Intelligent-
> Source-Manager-t1796890.html#a4896706
> Sent from the OpenAL - Dev forum at Nabble.com.
>
> _______________________________________________
> Openal-devel mailing list
> Openal-devel at opensource.creative.com
> http://opensource.creative.com/mailman/listinfo/openal-devel
> ForwardSourceID:NT0002ABE2
More information about the Openal
mailing list