OpenAL on Win32?

OpenAL on Win32?
0.0 0


I see there already is an implementation of OpenAL in CocosDenshion for Linux. Is there a reason this should not be ported to Win32? I see the lack of volume control in Win32 a rather big missing feature.

Is anyone planning on implemented this? If not I’d gladly try to port it.

Or would a SDL implementation work better?



Both would make sense I think.

SDL 2.0 would make sense as it’s finally moved after years to stable, but it’s a big set of dependencies.
Regarding OpenAL, would be wise to test against OpenAL soft ( since other implementations are proprietary.


I’ve implemented the OpenAL version, it works pretty smooth (but no mp3 support). I’ll have a look into OpenAL soft implementation. If anyone is interested I could fine tune it and make a pull request.


If you’re implementation is more complete than current Win32 one, then you should definitely submit a PR for it.
Regarding mp3 support, I think best bet would be to have OGG support instead through libvorbis, no licensing issues therefore;
I am personally interested in :wink:


Well it has music and sfx volume and OGG support


Well if you could share code or submit PR, would be great, well done :slight_smile:


You can check the commit here:
It’s based on the Develop branch but it should work on older ones (initially created on cocos2dx-2.1beta3-x-2.1.0)


I tried to get this code to work under Windows, but unfortunately no sounds play in Windows 7 with the files on that commit.

Trying to figure out what I might have done wrong. I tried with both WAV files and OGG files.


Have you guys checked out AudioEngine in 3.7rc0?

On Win32, OpenAL is implemented, setVolume per sound effect is implemented, and it supports playing MP3 via mpg123.

Strangely, there seems to be issues with wav files, or at least the format of wav that I tried to play caused a crash. Will need to look into that further.
Have yet to try to play OGG files.

WinRT AudioEngine uses XAudio2, but also supports MP3 now.

Is there a license issue regarding playing MP3 files on Windows?


I appreciate the enthusiasm for the newest release, but I have to be realistic.

I am definitely going to look at AudioEngine, but it appears that the API has undergone some major changes – but still does the same stuff!

At first glace, it will be difficult to port back to stable 2.2.6 – but it is a place to start.