Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (481)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (548)
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 2414 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 https://joal-demos.dev.java.net/. 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.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

atombrot (27 views)
2014-08-19 09:29:53

Tekkerue (25 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (15 views)
2014-08-16 06:20:21

Tekkerue (22 views)
2014-08-16 06:12:11

Rayexar (61 views)
2014-08-11 02:49:23

BurntPizza (39 views)
2014-08-09 21:09:32

BurntPizza (31 views)
2014-08-08 02:01:56

Norakomi (37 views)
2014-08-06 19:49:38

BurntPizza (67 views)
2014-08-03 02:57:17
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org 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‑gaming.org
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!