Need a bit of help with FMOD on Mac.

BlitzMax Forums/BlitzMax Programming/Need a bit of help with FMOD on Mac.

Sokurah(Posted 2011) [#1]
A while back I had the dreaded problem with a delay when playing sounds on certain Windows installations.

So a friend prepped this for me - a FMOD wrapper and things has worked just fine since then (he's on vacation and he hasn't got a Mac, which is probably why it doesn't work and I'm asking here instead). I don't really know how it works - just that it works and that it solves my problem. :-)

Now, I'd really like to compile my games on OSX and as far as I can see the idea is that if it's compiled on OSX it will import an extra wrapper and use that, without having to change all the Sound.Play("Some sample") commands scattered around the program, however, it doesn't work if I compile it on OSX. I get some kind of error.

Below is the code of the example - pretty minimal really. This is not where the problem is - that's in the wrapper, but this is just so you can see how simple things are kept.

I don't absolutely need to use FMOD on OSX btw - it can play through DirectPlay for all I care...as long as I don't have to change all the PLAY commands throughout my programs. ;-)

I've included all files needed to test it, in this file (http://dl.dropbox.com/u/2697142/MacSoundTest.rar) (300KB) which contains everything except BaH.FMOD which you'll also need, and I hope someone can help me get it working

SuperStrict

?Win32
	Import BaH.FMOD
?Not Win32
	Import "_soundwrapper.bmx"
?
Include "_fmod_wrapper.bmx"

Global SoundSystem:TFMODSystem = New TFMODSystem.Create()
SoundSystem.Init(100)

AppTitle = "Mac Sound Test"

Global AudioDrivers_list:TList = New TList
Type AudioDriverStrings
	Field Name:String
End Type

Graphics 800, 600

Incbin "Bleep.ogg"

?Win32
	Sound.Load("Bleep.ogg", 1)
?Not Win32
	Global BleepSND:TSound = LoadSound ("Bleep.ogg")

?
Repeat
	If KeyHit(KEY_ENTER) Then Sound.Play("Bleep")
Until KeyHit(KEY_ESCAPE) Or AppTerminate()