Ctank02's picture

OpenAL Missing Documentation?

None of the forums seemed right for this topic, so I apologize if this is the wrong place.

I am very new to OpenTK and even newer to audio programming. I have a few classes from a book I have been reading (it uses the Tao framework) that I am trying to convert to OpenTK.Audio.OpenAL.

One of the issues I am having is finding the documentation for openTK functions. For example, I searched the documentation for GetSource(), which is a function of AL, and the JavaScript search told me there were no matches....

Below is an example of 3 lines I am trying to convert where documentation seems to be very lacking:

        private bool IsChannelPlaying(int channel)
        {
            int value = 0;
            Al.alGetSourcei(channel, Al.AL_SOURCE_STATE, out value);
            return (value == Al.AL_PLAYING);
        }

Obviously, all the code is doing is polling the source's state to determine if it is playing.

Do to major trial and error, I have gotten to this point:

        private bool IsChannelPlaying(int channel)
        {
            bool value = false;
            AL.GetSource(channel, , out value);
            return (value == ALSourceState.Playing);
        }

Unfortunately, I have no idea what the middle parameter should be.

This is just one of many examples I have. Is there any documentation out there that I, and google, can't seem to find?

Thanks.


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Inertia's picture
private bool IsChannelPlaying(int channel)
        {
            int value;
            AL.GetSource(channel, ALGetSourcei.SourceState, out value);
            return (value == (int)ALSourceState.Playing);
        }

Besides OpenTK.dll you need OpenTK.xml, so Intellisense can help you with documentation.

Especially for this purpose, there's a convenience overload though:

private bool IsChannelPlaying(int channel)
{
  return ( AL.GetSourceState(channel) == ALSourceState.Playing );
}
Ctank02's picture

Thanks for the help.

Unfortunately, that wasn't my point (I'm not trying to be negative, I apologize if it comes off that way). I know of many people who know of but do not like OpenTK. Primarily, because it is so different from OpenGL and the others. Granted, using the 'Intellisense,' you can generally figure out what you need, but I must admit from a software engineering perspective, I believe some of this code needs at least some documentation. I believe the consensus from the more experienced members of the community was that you could just refer to OpenAL's documentation (this would work, if everyone was all ready an expert in OpenAL). Unfortunately, I don't think that works for new comers to the API. I am very experienced with OpenGL (In Python), so figuring out the differences of the API for OpenGL that aren't documented was easy; however, this isn't true for OpenAL (primarily because I lack the experience).

I believe many more people would be interested in OpenTK, if only the API was better documented (what is documented is done quite well, by the way).

I would be more than willing to help write this documentation; although, my knowledge is very lacking in OpenAL and OpenCL, so I would appreciate some help from people who are more experienced in those categories (I think this conversation may need to be moved, if it catches anyone's interest).

the Fiddler's picture

AL.GetSource is actually documented and intellisense shows its parameter names, types and documentation. For its second parameter, it reads:

Quote:

ALGetSourcei param

The name of the attribute to retrieve: ALSourcei.SourceRelative, Buffer, SourceState, BuffersQueued, BuffersProcessed.

Why this doesn't appear in the online documentation is the real question - please file a bug report.

Ctank02's picture

All right, I will file a bug report, and I knew it showed up in the Intellisense; however, I always feel those are more basic than what you would find online in the API documentation.

Thanks.

nythrix's picture

Edit: Response moved.