Advertisement

Open_AL Question

Started by January 14, 2005 12:09 AM
3 comments, last by Drew_Benton 20 years, 1 month ago
Ok guys I have question pertaining to OpenAL. There is this nice tutorial entitled "Programming 3D Sound with OpenAL in Windows" located here on GD. I have read it and the accompanying forum. What I do not understand is what the point of the code segment is:

ALCcontext *Context;
ALCdevice *Device;

Device = alcOpenDevice((ALubyte*)"DirectSound3D");
if (Device == NULL)
{
  exit(-1);
}

//Create context(s)
Context=alcCreateContext(Device,NULL);

//Set active context
alcMakeContextCurrent(Context);

// Clear Error Code
alGetError();
The only place it is used is in the cleanup code!

//Get active context
Context=alcGetCurrentContext();

//Get device for active context
Device=alcGetContextsDevice(Context);

//Disable context
alcMakeContextCurrent(NULL);

//Release context(s)
alcDestroyContext(Context);

//Close device
alcCloseDevice(Device);
I know he says -
Quote:
For my application I am going to use the basic method of setting it up for DirectSound3D but it is also possible to make use of EAX by checking for its availability.
But I had never done this in the AL audio wrapper I had made and it worked fine. Can someone please enlighten me? I have also looked at the provided source code for the tutorial and have not found anything different other than those segments. I have even found a different tutorial that used:

Context = alcCreateContext(Device, NULL);
Instead - so why the DirectSound3D if you choose to use OpenAL as your audio library? I actually added in that code and my audio class no longer works; that is why I am asking about it. There is also a beginning tutorial on OpenAL here which also makes no refrence to the alcCreateContext and company. One last thing is that I even consulted the OpenAL documentations on this topic, but ehh.... I'm still lost. Thank you for your time[attention] - Drew [Edited by - Drew_Benton on May 25, 2005 9:48:39 PM]
Ok, maybe im slightly retarted (possible :-p) but you used too many pronouns in your question... i dont know what "this" is when you said "But I had never done this in the AL audio wrapper I had made and it worked fine. Can someone please enlighten me? I have also looked at the provided source code for the tutorial and have not found anything different other than those segments. I have even found a different tutorial that used:" id be happy to answer the question but unfortunately... i dont understand the question!!! wooo!!!


but as an answer to your other question, you use direct sound because openAL is simply a wrapper for direct sound on win32 (unless you use special creative drivers iirc)


hope that helps
-Dan
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
Advertisement
Hehehe yea, I kind of noticed a lot of I's, but was like aww forget it - its late [smile]. As for the "this" I was refering to the previous quote - using DirectSound3D as well as using the alc_ functions. My question was basically why use the alc_ functions - in one tutorial they do and one tutorial they don't - but both seem to get the same end result.

Quote:
but as an answer to your other question, you use direct sound because openAL is simply a wrapper for direct sound on win32


This is news to me! So let me get this straigt - OpenAL was made on top of DirectSound...and that's it? I always thought it was its own API + functions. If that is the case - is the only way not to use DirectSound by using FMOD or BASS? Argh! I have no problem with DirectSound - but I might as well make my own wrapper with a more complete functionality.

Thanks for the response - I will await further comments and ponder wheter or not I should use OpenAL.

[Edited by - Drew_Benton on May 25, 2005 9:04:47 PM]
Well it depends on your drivers, creative drivers dont rely on direct sound as far as i know, but yes, on a windows platform, other than the creative drivers, it is a direct sound wrapper.

and yes, definitely still use openAL, i <3 openAL :-D, remember its portable, it works, its 100% free to use (unlike FMOD) and its an elegant API

hope that helps
-Dan
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
Ok cool. Thanks! I think I have a better idea about this topic now. I guess when it all comes down to it - most libraries use some form of Direct something [lol].

[Edited by - Drew_Benton on May 25, 2005 9:16:54 PM]

This topic is closed to new replies.

Advertisement