![]() |
| [[ Home | Forums | 3D Engines Database | Wiki | Articles/Tutorials | Game Dev Jobs | IRC Chat Network | Contact Us ]] |
|
|
#1 |
|
DevMaster Editor
Join Date: Jan 2005
Posts: 54
|
OpenAL Lesson 3: Multiple Sources
Author:: Jesse Maurais Description: Create an audio scene with more than one source Post your discussions/comments here by clicking on Add Reply. |
|
|
|
|
|
#2 |
|
New Member
Join Date: Jun 2003
Posts: 1
|
Hi, I am new here and just wanted to say that the source code link is broken!
|
|
|
|
|
|
#3 |
|
DevMaster Staff
Join Date: Jan 2003
Posts: 1,201
|
Thank you for telling us. I fixed it..and now all of them should work.
|
|
|
|
|
|
#4 |
|
New Member
Join Date: Jan 2003
Posts: 5
|
Hi!
Thanks Jesse for those excellent tutorials. One question: Is there a way to find out how man y resources you actually can create before using the function alGenSources(sizeOfBuffer,source); ? I get a INVALID_VALUE when I try to create more then 20 sources? Any ideas? |
|
|
|
|
|
#5 |
|
Member
Join Date: Jun 2003
Location: Airdrie, Alberta, Canada
Posts: 32
|
As far as I know there isn't any 'alGetInteger(AL_SOURCES)' feature. It would be a good idea for it to be added in the future though. However your problem is strange. There _is_ a limited number of buffers/sources but I'm pretty sure that it's 32 for each. Can you post (or e-mail me) more code so I can take a look at it?
___________________________________________
FRAG THE PLANET Ed Helms: Alcohol causes problems and guns solve problems. I don't see why you can't have guns in bars. Other guy: That's a stupid idea. Ed Helms: Yeah, if your a pussy. |
|
|
|
|
|
#6 |
|
DevMaster Staff
Join Date: Jan 2003
Posts: 1,201
|
Isn't the limit to the number of sources you can have dependent on hardware?
|
|
|
|
|
|
#7 |
|
Member
Join Date: Jun 2003
Location: Airdrie, Alberta, Canada
Posts: 32
|
Yes, actually. I had thought that the minimum requirement was 32, but I think I may be wrong now. I've spend more time going through the Creative source code and it looks like under the DS3D implementation the number of sources is based on how many can be allocated on your card.
___________________________________________
FRAG THE PLANET Ed Helms: Alcohol causes problems and guns solve problems. I don't see why you can't have guns in bars. Other guy: That's a stupid idea. Ed Helms: Yeah, if your a pussy. |
|
|
|
|
|
#8 |
|
New Member
Join Date: Sep 2004
Posts: 8
|
Shouldn't you delete the sources before trying to delete the buffers in KillALData()? Even if the sources are stopped, the buffers will still be tied to them.
|
|
|
|
|
|
#9 |
|
New Member
Join Date: Aug 2006
Posts: 3
|
Hello, I have a strange problem.
Based on your code I created a object oriented wav player. There seems to be a problem when using more than 1 object of that class. When only one object appears, everything works fine. But when I try to crate and simultaneously use 2 objects or more they seem to work correctly (sources are playing, at the end everything is deleted by a destructor), however at the end, after program exits I get a segmentation fault. Here is the code connected with class Wavplayer and small explanation: Program reads external text file which holds number of sounds needed in the level and paths to wav files. Based on this info it loads the sound, creates buffers etc. Problem appears when i specify 2 objects (ie. soundmaps for 2 levels). Works fine but there is a seg fault at the end. I am almost sure that the problem is connected with memory management however I wasnt able to trace a problem yet. Sorry for a little bit messy code, below example assumes there are only 2 files specified, and it requires some upgrades. Code:
Last edited by marcinekk : 09-11-2006 at 02:15 PM. |
|
|
|
|
|
#10 |
|
New Member
Join Date: Aug 2006
Posts: 3
|
ahhhh I found the mistake
![]() I had removed aluExit from the destructor in order not to revoke it twice, and eventually i forgot to paste it in my main.cpp SO alu remained open and I got these seg faults. |
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|