LWJGL
June 18, 2013, 15:57:26 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL is now using GitHub
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: Dynamically loading sounds : best practice?  (Read 1515 times)
kinoko
Newbie
*
Posts: 10


« on: December 02, 2011, 04:02:45 »

Sound files are loaded dynamically (=runtime) in my app.
I implemented 2 ways of doing this.

# 1    PlayOneSound
A player for a single source.
Many instances of the player.

# 2    PlayManySounds
A single static OpenAL player, that handles buffers/source inside.
With reusing buffers.

In general is there a preferred way of playing dynamically loaded sounds?

Also, in case of a single player (#2), is it possible somehow to fill up the same buffer ( AL10#alBufferData ) with different data?
AL10.alDeleteBuffers(int) seems to delete the buffer for good, just overwriting the data also fails.
(so this 2nd approach is not working as expected so far).
In other words, can I reuse bufferData / Source?


Logged
cleo
Newbie
*
Posts: 5


« Reply #1 on: March 19, 2012, 10:04:29 »

I just realized you seem to have the same question as I do (I just started a new thread with a complete program code).

Have you found a solution in the meantime? It would be highly frustrating if OpenAL could play only a limited preset sound library during runtime. Re-initiating all buffers whenever a sound is played would be ... not elegant.


Regards
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!