Framework Box2D - no more sounds?

BlitzMax Forums/Brucey's Modules/Framework Box2D - no more sounds?

Rick_72(Posted 2010) [#1]
Guys, there's no more sounds! Have a look at these imports please:

Framework bah.Box2d

Import brl.audio
Import brl.wavloader
Import brl.GLMax2D
Import brl.random
Import brl.FreeTypeFont


If I 'framework' B2D no more sounds are played. if I import B2D there's an OpenGL-issue.

What can I do about this?


Oddball(Posted 2010) [#2]
Import brl.FreeAudioAudio
or
Import brl.DirectSoundAudio
or
Import brl.OpenALAudio
instead of
Import brl.Audio



Rick_72(Posted 2010) [#3]
OK, thanks, those work. Is there any reason why the original audio stuff doesn't work?


Oddball(Posted 2010) [#4]
brl.Audio is a set of abstract functions which don't do anything unless there is a driver present. It's the same way brl.Max2D is organised. In your code above you import brl.GLMax2D, and not brl.Max2D, this is just the same thing except with sound.


Rick_72(Posted 2010) [#5]
Hmm, I had a look at brl.audio and it's more than a set of abstract functions. In fact it's setting drivers. Otherwise the examples in the manual wouldn't work (in the examples only brl.audio is imported).

The sounds are played if the framework is *not* set. As soon as the framework appears there's no more sounds. So I guess something is interfering somewhere. Would be nice to know what why how when.

Anyways importing other drivers works.


Oddball(Posted 2010) [#6]
If framework is not set then all the modules in brl.mod and pub.mod are imported. That means that when you don't use framework all the modules I listed above are imported. brl.Audio only contains the abstract driver, it won't do anything until a proper driver is imported and set. It's exactly the same with brl.Max2D. Try it. Only import brl.Max2D, instead of brl.GLMax2D, and you'll see that the graphics only stop working when you use framework.


Rick_72(Posted 2010) [#7]
Ah, OK! Now I got it. That means whenever I set a framework I have to include all neccessary stuff manually. Nice to know! On the other side does this mean I could define my own framework to prevent the compiler from putting all the useless stuff into my progs? Cool. I'll give a try.

Thanks OddBall, this answer helped a lot!