0
0

Hi, I’ve been stumbling around for a few hours trying to play a simple wave file on the HP iPAQ rx3715. Eventually I will need to play .aiff files, but just wanted to try fmod out with .wav first. I’m included the armv4 fmodce.dll file in the project. I’ve looked through the forums and some sample programs and I still can’t figure out what’s wrong.

This is the complete code for a test program.

[code:q81by0dg]
using System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Data;
using System.Runtime.InteropServices;

namespace FmodTest
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.MainMenu mainMenu1;
[DllImport("fmodce.dll")]
public extern static sbyte FSOUND_Init(int mixrate, int maxsoftwarechannels, uint flags);
[DllImport("fmodce.dll")]
public static extern IntPtr FSOUND_Sample_Load(int index, string name, uint inputmode, int offset, int length);
[DllImport("fmodce.dll")]
public static extern int FSOUND_PlaySound(int channel, IntPtr FSOUND_SAMPLE);

    public const uint FSOUND_8BITS = 0x00000008;
    public const uint FSOUND_16BITS = 0x00000010;
    public const uint FSOUND_STEREO = 0x00000040;
    public const uint FSOUND_MONO = 0x00000020;
    public const uint FSOUND_2D = 0x00002000;
    public const uint FSOUND_SIGNED = 0x00000100;
    public const uint FSOUND_UNSIGNED = 0x00000080;
    public const int FSOUND_UNMANAGED = -2;
    public const int FSOUND_FREE = -1;
    public const uint FSOUND_NORMAL = (FSOUND_8BITS | FSOUND_SIGNED | FSOUND_MONO);


    public Form1()
    {
        InitializeComponent();
        FSOUND_Init(44100, 32, 0);
        IntPtr samp1 = FSOUND_Sample_Load(FSOUND_UNMANAGED, &quot;\\Sounds\\I2849.wav&quot;, FSOUND_NORMAL, 0, 0);
        FSOUND_PlaySound(-1, samp1);            
    }
    /// &lt;summary&gt;
    /// Clean up any resources being used.
    /// &lt;/summary&gt;
    protected override void Dispose( bool disposing )
    {
        base.Dispose( disposing );
    }
    #region Windows Form Designer generated code
    /// &lt;summary&gt;
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// &lt;/summary&gt;
    private void InitializeComponent()
    {
        this.mainMenu1 = new System.Windows.Forms.MainMenu();
        this.Menu = this.mainMenu1;
        this.Text = &quot;Form1&quot;;

    }
    #endregion

    /// &lt;summary&gt;
    /// The main entry point for the application.
    /// &lt;/summary&gt;

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

}
[/code:q81by0dg]

Any help would be appreciated. This is driving me crazy.
Thanks.

  • You must to post comments
0
0

AAAAAAAAH!!!!!! I GOT IT TO WORK. Yeah apparently I had to create the filename as a byte array instead of strings in c#, which are in unicode. Thanks anyway.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.