Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (711)
Games in Android Showcase (213)
games submitted by our members
Games in WIP (785)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  No Sound with more than 16 Buffers!  (Read 2919 times)
0 Members and 1 Guest are viewing this topic.
Offline rinschwinder

Senior Newbie

« Posted 2005-06-16 16:43:42 »

Hello everyone!
This is my first projekt with openAl ever so I just orientated on the tutorials postet on I wrote a SoundEngine wich uses a PropertyFile to read Path-Information to fill the buffers in a for-loop. This method looks similar to the one from lesson1 in the tutorial. To play the Sounds, I have two methods, one which just plays the Sound (Lesson1), and one which uses this "Sources Sharing Buffers" (Lesson5)... this all works, but: If I have more than 16Files to load, the programm starts with no exceptions and other abnormaltiys, but in most cases I hear no Sound! It happens that its playing 16 Sounds each sized 10MB but refuses playing 17 Sounds sized 1MB.
Does anyone know how to avoid this problem or what I am doing wrong? Is there maybe a way to create just 16 Buffers an switch the sounds in case of use? This leads to my next question: How much Data can JOAL handle.. at this time at starttime I have to load 80MB of Wave-Data.. Is it neccessary to have a strategy like this and does anyone know some examples?

I am happy for every attemp of helping!
Rin Schwinder
Offline tom
« Reply #1 - Posted 2005-06-16 18:09:57 »

OpenAL will use the hardware to play more than one sound at the same time. How many you can play depends on the sound card. I think the minimum is 16 and is common on cheap, buildt in cards.

You can bind any buffer to a source. So if you don't have to play more than 16 at the same time, then you can write some code that manages the sources. Playing sounds on sources that is not in use.

Don't know how much data OpenAL can handle. But if your using alot, and it seems you do, you might consider streaming ogg files instead.

Offline rinschwinder

Senior Newbie

« Reply #2 - Posted 2005-06-19 11:13:52 »

Managing more Sources works quite well, the problem is, that I can just have 16 BUFFERS filled with Wave-Data at the same time. I can bind more Sources depending on these buffers, but in this case I just can use 16 Sounds in this game but need a bit more....
Does anyone know how to fix it? Maybe exchange the wave-Data in the buffers dynamicly?Huh
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline tom
« Reply #3 - Posted 2005-06-19 17:08:37 »

There is virtually no limit to the number of buffers you can use. Try again with smaller sounds to see if that help. If that works and the large sounds don't, then you might be seeing some limitation of amount of data OpenAL can handle.

Offline rinschwinder

Senior Newbie

« Reply #4 - Posted 2005-06-19 21:24:46 »

Thank You for the quick replies!!
I tried it using different Wave-Data... Even if I used 1MB-Waves or 10MB Waves... all time it was the magic number "16" which made the limit...
Offline tom
« Reply #5 - Posted 2005-06-20 00:01:31 »

I'll bet your generating a source for each of the buffers. Lesson 5 is kind of flawed. It creates a new source for each new sound. It is ok in the lesson because all the sounds are looped and they will all be played at the same time. It is NOT something you will want to use in the real world.

What you need to do is this:
1) At startup sit in a while(true) loop creating as many sources as you can.
2) Load your sounds into buffers
3) In your game you will:
a) Find a source that is not currently playing. If they are all playing you must decide if you want to replace any of the playing sounds with the new one
b) Once you've got the source you can stop it if it is playing. Then bind the new buffer to the source and play it.

If you still can't get it to work, post some code.

Offline rinschwinder

Senior Newbie

« Reply #6 - Posted 2005-06-20 15:24:31 »

I´ll give it a try.... I hope it will work better this way... I´ll soon report if I had success or otherwise post some code.... Wink
Offline rinschwinder

Senior Newbie

« Reply #7 - Posted 2005-06-26 18:13:16 »

Seems that my Soundcard has caused the problems.. I ported the code to another machnie and suddenly it worked.. quite strange...
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

numerical (284 views)
2017-02-21 07:32:16

numerical (282 views)
2017-02-21 07:31:46

theagentd (394 views)
2017-02-18 13:42:33

theagentd (393 views)
2017-02-18 13:35:16

h.pernpeintner (1560 views)
2017-01-24 22:39:11

h.pernpeintner (1547 views)
2017-01-24 22:38:32

Galdo (2111 views)
2017-01-12 13:44:09

Archive (2108 views)
2017-01-02 05:31:41

0AndrewShepherd0 (2644 views)
2016-12-16 03:58:39

0AndrewShepherd0 (2349 views)
2016-12-15 21:50:57
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!