Archived

This topic is now archived and is closed to further replies.

OpenAL max ammount of sounds???

This topic is 5301 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

OK, I''m using OpenAL for sound in my game and every sound file loaded after my 32nd doesn''t load, and the file path is correct, if i switch the order they load in then the the nonworking ones will now work and the working ones wont, so there must be a limit to how many it can load or something //So here is my struct struct JSOUND { char* buffer; ALenum formatBuffer; ALsizei freqBuffer; long bufferLen; ALboolean loop; unsigned int source; unsigned int sampleSet; ALfloat sourcePos[3]; ALfloat sourceVel[3]; }; // and here is how i call it #define S_MAXSOUNDS 37 JSOUND sound[S_MAXSOUNDS]; Anyone have any ideas of how I can fix it... and is there anything I dont need in this structure that I have in there?

Share this post


Link to post
Share on other sites
Well there is no "Sound Forum" So OpenAL fit best in OpenGL I guess, unless you have a better idea of where this post should have gone...

Well how do I get around the limit of 32 sound effect?

And The answer is simple, I''d like to have something more like 60 or 70 sounds, I''m writing a full out game and 3d engine, Quake 3 uses over 200+ sounds, maybe even 300 at a time
(And yes I am aware of memory, each sound is usually under 1 second) like footStep1.wav, footStep2.wav, footStep3.wav, bloodSplat1.wav, bloodSplat2.wav, bloodSplat3.wav....

Share this post


Link to post
Share on other sites
given most sound cards only hardware mix 32 channels anyways, playing 300 at a time would need software mixing anyways... btw, i doubt Q3 players 300 AT ONCE, hell, i doubt the human ear could work out 300 sounds at once without it sounding like a mess, it might have alot in memory and then rebind the buffers as it needs to play a different sound effect.

Share this post


Link to post
Share on other sites
Oh thats not what I mean, and I never said I wanted to play more than 32 sounds at once nor does Quake 3 play 300 sounds at once, I just said use - meaning it can load that many, deal with that many, handle that many, of course I dont want to play that many sounds but would I would like is a simple answer of how to do it, and if you dont know just don''t respond, you don''t have to bust my balls about if I posted this in the wrong forum in your opinion or telling me that Quake can''t have 300+ sounds ''cause it can :-)

Thank You.

Share this post


Link to post
Share on other sites
-And. You shouldn''t load all your sounds into the Sound Buffers at startup. You should (on each frame) test what sounds can be heard. -And then load that sound into an avalible Sound Buffer.

Remember the number of Sound Buffers vary from each SoundCard. -My card can''t take more than 16 voices.





-----------------------------
AM

Share this post


Link to post
Share on other sites
"what''s this have to do with OpenGL? maybe should go in a different forum."

yeah i agree, there''s been a lot of off topic posts recently. Things are getting really slack, we should try to clean this place up a bit. On another note, maybe a sound specfic sound forum would be a good idea.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by jmoses
Well there is no "Sound Forum" So OpenAL fit best in OpenGL I guess, unless you have a better idea of where this post should have gone...

Well how do I get around the limit of 32 sound effect?

And The answer is simple, I''d like to have something more like 60 or 70 sounds, I''m writing a full out game and 3d engine, Quake 3 uses over 200+ sounds, maybe even 300 at a time
(And yes I am aware of memory, each sound is usually under 1 second) like footStep1.wav, footStep2.wav, footStep3.wav, bloodSplat1.wav, bloodSplat2.wav, bloodSplat3.wav....


YEAH SURE RELATES TO OPENGL

Share this post


Link to post
Share on other sites
"what''s this have to do with OpenGL? maybe should go in a different forum."

Honestly i don''t see a big problem with this.., might be off topic, but people will need to use sound on their applications anyways, and this thread already has 120 views, so i guess many people is interested in this topic.

Share this post


Link to post
Share on other sites
Jesus Christ guys, you don''t need to flame me because there is no sound forum, All I was asking for was some help you don''t need to flame me. I mean my engine is in OpenGL, and openAL ties into OpenGL, so this DOES seem like a good place to start, in fact to do a test I invited two friends over and asked them what forum I should post an OpenAL question, and both said they''d post them in a OpenGL forum becuase thats the closest thing to it.
And to walrus; maybe people have been posting off topic stuff, but it wasn''t me so quit your crying ;-)

Now that everyone has flamed me because this post COULD HAVE MAYBE been put in a differnt forum, would soneone like to help?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
"Jesus Christ guys, you don''t need to flame me because there is no sound forum, "

i would hardly call those posts flames the majorty seem to be trying to be constructive and are looking out for the best interest of this forum.


"Honestly i don''t see a big problem with this.., might be off topic, but people will need to use sound on their applications anyways, and this thread already has 120 views, so i guess many people is interested in this topic."


The problem is when on person starts doing it more and more will follow...what wrong with one person doing it???? what if every third person that came to this forum started posting off topic...We would get a nice forum general topic forum but a bad OpenGL forum.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
"Jesus Christ guys, you don''t need to flame me because there is no sound forum, "

i would hardly call those posts flames the majorty seem to be trying to be constructive and are looking out for the best interest of this forum.


"Honestly i don''t see a big problem with this.., might be off topic, but people will need to use sound on their applications anyways, and this thread already has 120 views, so i guess many people is interested in this topic."


The problem is when on person starts doing it more and more will follow...what wrong with one person doing it???? what if every third person that came to this forum started posting off topic...We would get a nice forum general topic forum but a bad OpenGL forum.

Share this post


Link to post
Share on other sites
quote:
Original post by jmoses
Now that everyone has flamed me because this post COULD HAVE MAYBE been put in a differnt forum, would soneone like to help?

Everyone just wants to a be little forum police and look important in this little world

Share this post


Link to post
Share on other sites
The forum FAQ states "Anything OpenGL can go in this forum (I guess stuff that is related to OpenAL and SDL can also go here)." I don''t see what the problem with this post is. It is on topic.

Share this post


Link to post
Share on other sites
Thank you Stefu and DC_Tsunami, I agree.

Now can we go back to the topic of which the topic states? I''d like to get my problem fixed :-)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
"Everyone just wants to a be little forum police and look important in this little world"

I hardly think that''s it, if the posts where more flame type post then i would agree, but the guys just mentioned that this is off topic and would be better suited for the general forum. Additionally, it might be more benifitial to the initial poster if he posted on the correct forum. I mean, since this is supposed to be a GL forum, there might not be many uses here that have deal with openAL where as a general programming/game program forum would have more uses who would be qualified to answer this.

Ulitmatiely, I think people just want to maintain the integrety of this forum.


"The forum FAQ states "Anything OpenGL can go in this forum (I guess stuff that is related to OpenAL and SDL can also go here)." I don''t see what the problem with this post is. It is on topic. "

I think this is debatable, other than their name, they arn''t directly related. It''s as much related as OpenGl is to DirectSound, ofcouse minus the platform independent nature of OpenAL

Share this post


Link to post
Share on other sites
quote:
Original post by jmoses
Thank you Stefu and DC_Tsunami, I agree.

Now can we go back to the topic of which the topic states? I''d like to get my problem fixed :-)


Have you tested if there''s error with
alGetError();?

I just started programming OpenAL to my game, so I can try this propably tomorrow.

But about your JSOUND struct: Do you have one al source and one al buffer for each JSOUND? I can see the ''uint source'', but don''t see ''uint buffer'', but still you have ''char *buffer''.

For example here is how you can share buffers with sources.

Now, there I have also a question, how many sound sources can I have? Can I make one source for each real source for example I find in car game (for each car: engine, gearbox, rubbers, suspension, etc.) and OpenAL handles this and plays only most sources closest to listener, or do I need to have fixed amount sources and share them with all real sound source?

I''ll be back tomorrow and try something more, but now it''s late.

Share this post


Link to post
Share on other sites
quote:
Original post by jmoses
Well shouldnt there be a buffer for every source for every sound file that you load, or is that not how it works?


Yes. Buffer (use alGenbuffers to create buffer) must exist for each sound file you load.

Source (use alGenSources to create source) tells how to play a buffer. Multiple sources can share one or more buffers.

For example I can have car engine sound I load in engine_buffer.
Then I have 20 cars, for each car I have a source, that plays engine_buffer. Source is sound position, veloity (for doppler effect), etc. parameters, that tell how to play certain buffer.

This is for 3d sounds.
IIRC buffers can be played directly like 2d sound effects, without sources.

OpenAL Specification and Reference


[edited by - stefu on June 7, 2003 3:36:40 AM]

Share this post


Link to post
Share on other sites
quote:
Original post by Bruno
How can you play buffers directly ?
I always tought it was only possible to play sources..


You are right. I was misremembering something I did time ago, but it was with DirectSound.

Share this post


Link to post
Share on other sites