Is there a difference between the call to createSound on MAC vs. WINDOWS? I am using a C# wrapper that can link to either library depending on the platform: i.e. fmodex.dll or libfmodex.dylib. I need to know if there is a fundamental difference in the way this particular call is made on the two platforms. Should I be casting the url as something special? Thank you in advance for reading my post.
[code:3cinxwca]result = system.createSound("http://ogg2.as34763.net/vr160.ogg";, (FMOD.MODE.HARDWARE | FMOD.MODE._2D | FMOD.MODE.CREATESTREAM | FMOD.MODE.NONBLOCKING), ref sound); // doesn’t work on Mac, but does on Windows
result = system.createSound("Assets/FMOD/jaguar.wav", (FMOD.MODE.HARDWARE | FMOD.MODE._2D | FMOD.MODE.CREATESTREAM | FMOD.MODE.NONBLOCKING), ref sound); // works on both platforms[/code:3cinxwca]
- Gandalf458 asked 5 years ago
Thank you so much! I knew that it had to be something like that. Now that I look at it, I suppose I should have guessed that, but I am very new to FMod as well as to Mac development.
I’m going to check the new .dll on a Mac, but so far so good, I made the changes to the DLLImport parts of the function. Then it wouldn’t run. So, then I also removed the mode = mode | FMOD.MODE.UNICODE; from the functions. Now, it does work on Windows. About to test it on a Mac later tonight.
The C# wrapper isn’t designed with Mac in mind (it can work) but you will need to make some changes.
Take a look at the DllImport section of fmod.cs, you will see the FMOD_System_CreateSound and FMOD_System_CreateStream calls use CharSet.Unicode (this works on Windows because FMOD supports wide chars, however Mac does not). Change the CharSet to CharSet.Ansi to fix this for Mac.
If you want both Mac and Windows to be consistent here, set the CharSet to Ansi for both and remove "mode | FMOD.MODE.UNICODE" from the createSound and createStream C# functions.
Please login first to submit.