0
0

OK, I’ve spent like 2 days trying to make an simpel pocketpc app playing a mp3 file. Now at last I got it to work and perhaps this will help some newbies (like me:)) out there!

Well what you need is VS2005 (I used pro ed.) and .net CF 2 should come with this version. What you need next is a C# wrapper for fmodce library. To make this clear, a wrapper could be a class or DLL/library containing the methods needed to call the functions in fmodce library (fmodce.dll).

Now this fmodce wrapper written in C# is already available here in the forum: http://52.88.2.202/forum/viewtopic.php?t=4874.
Remember the wrapper is only the first section of the codes (there two sections of codes in that post). The second part of the codes is used to play/stop a mp3 file.

Great thanks to dankrusi for the wrapper!

There are two 2 ways of implementing the wrapper into your codes.

we’ll talk about the first way first:

The first way is to create a new cs file where you copy the whole wrapper found in the post into this file. Remember to change the names of the class/file if you want to. The next step is to add this cs file to your project: in vs2005: file->move *.cs into.

In order to run any of the methods in the wrapper file we’ve just created we must have a main class. In vs2005, creation of a project will give the main class calls form1.cs. To test the app. works, simply add a button on the form1.cs, double-click on the button and you will get to the button method. Now you add this code into this button method:

//////////////////////////////////////////////////////////

// Declare our handles
IntPtr soundStream;
IntPtr soundHandle;

// Initialize fmod with mixrate equal to 44.1kHz
FMOD.PPC.Init(44100, 16, 0);

// Initialize the handle with the track file.
// Note that you must provide the full Pocket PC path. See http://msdn.microsoft.com/library/defau … ppc_io.asp for more info…
soundStream = FMOD.PPC.GetStream("test.mp3");

// Open the stream in Normal mode, which is combination of Mono sound, 16 bits, Signed
soundHandle = FMOD.PPC.Open(soundStream, 0x100, 0, 0);

// Start playing
FMOD.PPC.Play(0, soundHandle);

//////////////////////////////////////////////////////////

Remember pieces of this code is taken from the second section of the codes posted by dankrusi. Remember also to change the path of the mp3 file.

The program should be able to be compiled with no errors.
However do not use the pocketpc emulator that comes with vs2005,
because it won’t allow you to place fmodce.dll into emulatoren when compilling/debugging. Hence the app. won’t be able to find the fmodce.dll.
So use a real pocketpc to try this out. The next thing is important; the choice of fmodce.dll. There are plenty of them in the sdk 3.75, please choose the corresponding one. I personally used the one found in: \api\wce4\armv4 and I got a HP hx4700.

After compiling you’ll get the .exe file. Copy this to your pocketpc to try out. Remember to put the fmodce.dll IN THE SAME PATH/DIRECTORY AS THE .exe. You could add a test.mp3 in the same directory to test if you havent altered the code above.
Now you should have a program with a single button, which play the mp3 file if pressed.

The other way to implement the wrapper is through use of DLL/library. This can be done by choosing library instead pocketpc app when creating a project in vs2005. Next is to copy the wrapper code into the main class(form1.cs) and build the dll project. You should get an dll file (instead of a .exe).
Now create another project to test whether things work. First, you must add the dll file as reference into the project; right click the references(in solution explorer)->browse->choose ur dll and add. Your project should now have the dll implemented. Now the dll is implemented into your project, you can try to create a button to test whether it works. This can be achieved as first method. Just remember that to call any functions in the dll you must specify following; namespace.class.method. These should correspond with the names you created in the dll project.

Thats it, and good luck!

  • You must to post comments
0
0

Has anyone streamed from HTTP using FMOD Pocket PC C# environment?

  • You must to post comments
0
0

Has anyone solved problem that vs.net 2005 can’t find fmodce.dll library ?
I do not have any Smartphone (device) so I would like to create simple mp3 player on emulator.

  • You must to post comments
0
0

Hello!

I would need help how to record MP3 in VB.net/Compact framework 2.0 for a college project.

Could you help me?

lajosgodor@atw.hu

Thank you!

  • You must to post comments
0
0

Thanks for that investigation. We don’t natively support C# with fmod 3, so this thread is worth being stuck so others can use it.

  • You must to post comments
0
0

he11o, can you help me to choose a correct fmodce.dll. I use VS2008, .net 3.5, WM 5.0 PPC emulator.

  • You must to post comments
0
0

Does anyone have a c# wrapper to fmodce.dll that allows sounds from buffer?

I’m a game programmer and its important for us to keep our sounds locked away in a resource file; my only option is to play sounds from memory. However the wrappers I’ve seen all want a file name or a file handle.

If its not already available, I’ll be working on this myself.

( I’m sad that FMOD EX does not support Windows CE :/ )

  • You must to post comments
0
0

Hi, I do not speak English.
I use this code [url:1vrojd09]http://www.fmod.org/forum/viewtopic.php?t=4874&postdays=0&postorder=asc&start=0&sid=1d8e70f12837f6d5a9abe8b373311ee3[/url:1vrojd09].
Everything is working, but leaking memory. Help.

  • You must to post comments
0
0

okaton did you fix your issue? I am having the same problem

  • You must to post comments
Showing 8 results
Your Answer

Please first to submit.