Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Well, that was pretty easy...

Sign in to follow this  


So, it turns out that multi-threading with OpenAL/Ogg Vorbis is easier than I expected, which is always a bonus [grin]

Once I got passed the 'dont even try to use the dynamic dll runtime' issue with the Win32 libraries (someone REALLY needs to fix that, I've tried but even a recompile with the right settings doesnt seem to fix it) and found some simple template code from devmaster for streaming it was a pretty easy fix to write a little adapter struct and plug it into a boost::thread object, tada! streaming Ogg Vorbis files [smile]

One thing of note, the streaming example sitting in a loop and queries the state of the playback in the orignal thread, for some reason this causes things to explode with OpenAL. This is probably down to me writting data in one thread and querying OpenAL in another, which I'm guessing isnt remotely reentrant thus its a short trip to errorville via no-more-sound town [wink]

Sign in to follow this  


Recommended Comments

OpenAL + OGG = the r0xer! Love that stuff. I too need to make my audio library use threads [lol]. Glad to hear how painless it has been, I've been putting it off for a while.

Share this comment

Link to comment
If you want the very very simple code I've got then give me a shout and ya email and i'll throw it in your direction, it might not be much use to you but ya never know [smile]

@Rob Loach
Fmod is all very well and good but I just dont like its interface and stuff like that really annoys me, heck it led to me dismiss all the current crossplatform windowing libraries for OpenGL and go out and make my own [grin]
If i was writing a game then I'd probably use it, but my long term goal isnt so much a game as an engine with a test game and all the learning which goes with it, so doing it this way is a good way to learn [smile]

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!