0
0

First, sorry for my poor English, I’m spanish….

This is my code:

    private FMOD.System system = null;
    private FMOD.Sound sound1 = null;
    private FMOD.Channel channel = null;

private void playSoundButton_Click(object sender, EventArgs e)
    {
        uint version = 0;
        FMOD.RESULT result;

        /*
            Create a System object and initialize.
        */
        result = FMOD.Factory.System_Create(ref system);
        ERRCHECK(result);

        result = system.init(32, FMOD.INITFLAG.NORMAL, (IntPtr)null);
        ERRCHECK(result);

        result = system.createSound("../drumloop.wav", 
                                                   FMOD.MODE.HARDWARE,
                                                   ref sound1);

        ERRCHECK(result);

        result = system.playSound(FMOD.CHANNELINDEX.FREE,
                                                sound1, false, ref channel);
        ERRCHECK(result);

        system.update();

        channel.setCallback(FMOD.CHANNEL_CALLBACKTYPE.END,
                                      myCallback, 0);
    }

    private void stopSoundButton_Click(object sender, EventArgs e)
    {
        FMOD.RESULT result;
        system.update();
        result = sound1.release();
        system.update();
        ERRCHECK(result);
    }


    private static FMOD.CHANNEL_CALLBACK myCallback = new FMOD.CHANNEL_CALLBACK(myCallbackFunction);


    private static FMOD.RESULT myCallbackFunction(IntPtr channelRaw,
                                           FMOD.CHANNEL_CALLBACKTYPE tipo,
                                           int comando,
                                           uint datoComando1,
                                           uint datoComando2)
    {
        MessageBox.Show("NOW!!");
        return FMOD.RESULT.OK;
    }

The MessageBox NEVER is showed. What is bad in my code?

  • You must to post comments
0
0

We’ve just released a C interface, this means we can now move onto a C# interface which is coming soon.

  • You must to post comments
0
0

[quote="brett":34zqz8np]We’ve just released a C interface, this means we can now move onto a C# interface which is coming soon.[/quote:34zqz8np]

Ok., Thanks.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.