0
0

I have written a small wrapper for using fmod in C#. I can load a stream fine, but as soon as I try to play the file I get a “native Exception” and the program exits with no debug information. I am using an iPaq 3870 with an Arm processor, so I am quite sure I am using the proper DLL. Any help would be greatly aprecisated.

Brian[/code]

  • You must to post comments
0
0

Same here! I am getting the same error.

I’m using an iPAQ 2210 running Windows Mobile 2003, could somebody just confirm that I’m using the correct dll (fmodapi373ce/api/wce4/armv4/fmodce.dll)?

Could somebody maybe post some known working code that will simply play an mp3 using .NET p/Invoke calls?

Cheers,
Steve

  • You must to post comments
0
0

Oh, and this the code i’m trying to get to work…
[code:282mo01v]
using System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Data;
using System.Runtime.InteropServices;

namespace SoundTest
{
public class SoundTestForm : System.Windows.Forms.Form
{
[DllImport( "fmodce.dll", EntryPoint="FSOUND_Init" )]
public static extern bool FSOUND_Init( int mixrate, int maxsoftwarechannels, uint flags );

    [DllImport( "fmodce.dll", EntryPoint="FSOUND_Stream_Open" )] 
    public static extern IntPtr FSOUND_StreamOpen( string name_or_data, int mode, int offset, int length ); 

    [DllImport( "fmodce.dll", EntryPoint="FSOUND_Stream_Play" )] 
    public static extern int FSOUND_StreamPlay( int channel, IntPtr stream ); 

    public SoundTestForm()
    {
        IntPtr a;
        bool inited = FMODMethods.FSOUND_Init(44100, 32, 0);
        a = FMODMethods.FSOUND_StreamOpen("music.mp3", 0x00002000, 0, 0);
        FMODMethods.FSOUND_StreamPlay(-1, a);
    }

    protected override void Dispose( bool disposing )
    {
        base.Dispose( disposing );
    }

    static void Main() 
    {
        Application.Run(new SoundTestForm());
    }
}

}
[/code:282mo01v]

I get “A native exception has occurred in SoundTest.exe” on the screen of the PocketPC.

According to the .NET debugger,
inited = true
a = 0
just after the exception occures.

The MP3 music.mp3 is in the same directory as the executable on the PocketPC.

Any help is greatly appreciated!

Cheers,
Steve

  • You must to post comments
0
0

Hi Brett,

Thanks for the suggestion, but that’s not it.

pragma unmanaged is a C++ compiler directive, and the C# compiler doesn’t recognise it.

-Steve

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.