[Openal] OpenAL with C++ WindowsForm application?

Stefanos A. stapostol at gmail.com
Tue Sep 29 08:49:25 PDT 2009


On Tue, 2009-09-29 at 18:10 +0300, Ümit Uzun wrote:
> Can OpenTK support me same control? Does it let me to change
> BufferData's ingredients to play my expected channels only? 

As far as I can see, OpenTK supports everything necessary for
Framework.cpp.  Just note that you won't be able to use this file
directly.

The reason is that OpenTK is a .Net API, not a C API like OpenAL. This
means that some concepts will be slightly different - and I'm not sure
whether this is the best route for your application.

C++/CLI can use both C APIs and .Net APIs natively - both approaches can
work, but depending on the specific API one might be easier than the
other. In this case, maybe it would be simpler to modify
GetWaveALBufferFormat() with an implementation that does not use
function pointers at all?

If this is not possible, you can translate parts of ALFW to use OpenTK.
I don't know how large ALFW is, but I suspect this is going to be a lot
of work.

Framework.cpp itself should be relatively easy to translate:

1. ALFW[Init/Shutdown]OpenAL() init / deinit can be replaced by a single
line of code: just create an OpenTK.::Audio::AudioContext() instance.
OpenTK also provides ALC bindings (OpenTK::Audio::OpenAL::Alc), but
there's little reason to use them.

2. EFX extensions are initialized automatically (no need to set up
function pointers and initialize them by hand). This means that 50% of
Framework.cpp is redudant and can be removed completely.

3. ALFWLoadWaveToBuffer() can be translated directly to use
OpenTK::Audio::OpenAL::AL methods.

All in all, the resulting implementation will be about 1/3 of the
current Framework.cpp.

> If I bother you please forgive me I haven't played OpenTK yet, and I
> don't know it's capability.

Hey, no problem! :)




More information about the Openal mailing list