Somebody could exactly tell me how should I compile fmodce.dll with Compact Framework 2.0? I need to play MP3 files and downloadable compiled fmodce.dll does not play MP3 files with CF 2.0.
Please I need some urgent light on this.
Thanks in advance.
- lonifasiko asked 13 years ago
I followed the code from:
http://www.codeproject.com/useritems/Si … or_PPC.asp
The authors code worked, my project in CE forms 2.0 did not. Used the exact same code in forms 1.0 and it works. Problem occurs on FSOUND_Stream_Open as it always returns 0 under forms 2.0. All other calls seem fine (however FSOUND_Stream_Play may be broken as well as I can’t get that far succesfully).
I guess for now you will have to build in 1.0 and upgrade it once the CE dll is updated.
- Anonymous answered 13 years ago
Hi Fhaze. Thanks for the reply!
I think this is the first time someone answers one of my posts in this forums. God exists! Maybe I make stupid posts 😆
Actually I managed myself to play MP3 files with CF 1.0 with my own code, but same code, as you say, did not work for CF 2.0. Just MP3 file is not played. Any exception is thrown and all seems to work ok, but no music out there! 👿
I’ve read some posts here talking about not building a new fmodce.dll each time Microsoft delivers another new platform (Compact Framework 2.0). I understand this guys’ behaviour, they cannot be continuosly building millions of different DLLs depending on Microsoft’s next release. And also, I understand actual and downloadable fmodce.dll targets only CF 1.0. It has not been compiled for targeting CF 2.0. That’s the main problem but I would gratefully hear any other opinion.
Please tell me if you find a way to play MP3 files with CF 2.0. I need it urgently.
PD: I’ll try tomorrow morning CodeProject’s example but seems that only targets CF 1.0.
That the codeproject sample doesn’t work is due to a bug that exists in NETCF V1: http://www.opennetcf.org/forums/topic.asp?TOPIC_ID=2782
The fmod_getStream in frmMain.vb adds “+ 4” to AddrOfPinnedObject. This was needed to workaround the bug in NETCF V1, but should removed for V2. I suggest the following fix:
[code:34edw8fz]Private Function fmod_getStream(ByVal filename As String) As IntPtr
Dim filenames As Byte() = Encoding.Default.GetBytes(filename & vbNullChar)
Dim hfile As GCHandle = GCHandle.Alloc(filenames, GCHandleType.Pinned)
If Environment.Version.Major = 1 Then
‘ Add +4 due to a bug in netcf v1
fmod_getStream = New IntPtr(hfile.AddrOfPinnedObject().ToInt32 + 4)
fmod_getStream = New IntPtr(hfile.AddrOfPinnedObject().ToInt32)
- mattias answered 13 years ago
You are my GOD! 😀
I can now say that I’ve tried and the example have worked perfectly.
It’s incredible how many headaches can give in a CF 2.0 application a little fix for a bug in CF 1.0!
I think your fix will solve many problems to people trying to play MP3 for CF 2.0.
Thanks very-very much again.
Please login first to submit.