0
0

Dear C# PocketPC Developers,

Below is a class that wraps some simple FMOD functions, which enable you to easily implement playing of MP3 etc into your application…

Note that you need a corresponding ‘fmodce.dll’.

For beginners wondering how to add a Reference for this DLL – you don’t! We are directly linking to this DLL using the command [DllImport(“fmodce.dll”)]. Just make sure it is in the same directory as your application…

Wrapper Class:

[code:mainvg68]
using System;
using System.Runtime;
using System.Runtime.InteropServices;

namespace FMOD
{
/// <summary>
/// FMOD Wrapper for Pocket PC – C#
/// See www.fmod.org for more information.
///
/// DLL Import by Dan Krusi (dan at brainwings dot com)
///
/// This code is written for FMOD 3.75CE, which is
/// available at www.fmod.com. To use FMOD, you need
/// the correct version of fmodce.dll that corresponds
/// to your emulator / Pocket PC.
/// </summary>
public class PPC
{
/// <summary>
/// Gets a stream handle for the given filename
/// </summary>
public static IntPtr GetStream(string filename)
{
// Get the filename in bytes
byte[] filenamebytes = System.Text.Encoding.Default.GetBytes(filename+null);

        // Get a handle depending on which framework we are using
        GCHandle hfile = GCHandle.Alloc(filenamebytes, GCHandleType.Pinned);
        if (Environment.Version.Major == 1) return new IntPtr(hfile.AddrOfPinnedObject().ToInt32()+4);
        else return hfile.AddrOfPinnedObject();
    }

    /// &lt;summary&gt;
    /// Initialize FMOD
    /// &lt;/summary&gt;
    [DllImport(&quot;fmodce.dll&quot;, EntryPoint=&quot;FSOUND_Init&quot;, SetLastError=true, CharSet=CharSet.Unicode, CallingConvention=CallingConvention.Winapi)]
    public static extern bool Init(int mixrate, int maxsoftwarechannels, int flags);

    /// &lt;summary&gt;
    /// Get the length of a stream
    /// &lt;/summary&gt;
    [DllImport(&quot;fmodce.dll&quot;, EntryPoint=&quot;FSOUND_Stream_GetLength&quot;, SetLastError=true, CharSet=CharSet.Unicode, CallingConvention=CallingConvention.Winapi)]
    public static extern int GetLength(IntPtr fstream);

    /// &lt;summary&gt;
    /// Get the current position of the stream
    /// &lt;/summary&gt;
    [DllImport(&quot;fmodce.dll&quot;, EntryPoint=&quot;FSOUND_Stream_GetPosition&quot;, SetLastError=true, CharSet=CharSet.Unicode, CallingConvention=CallingConvention.Winapi)]
    public static extern UInt32 GetPosition(IntPtr fstream);

    /// &lt;summary&gt;
    /// Open a stream
    /// &lt;/summary&gt;
    [DllImport(&quot;fmodce.dll&quot;, EntryPoint=&quot;FSOUND_Stream_Open&quot;, SetLastError=true, CharSet=CharSet.Unicode, CallingConvention=CallingConvention.Winapi)]
    public static extern IntPtr Open(IntPtr data, int mode, int offset, int length);

    /// &lt;summary&gt;
    /// Start playing from the stream
    /// &lt;/summary&gt;
    [DllImport(&quot;fmodce.dll&quot;, EntryPoint=&quot;FSOUND_Stream_Play&quot;, SetLastError=true, CharSet=CharSet.Unicode, CallingConvention=CallingConvention.Winapi)]
    public static extern int Play(int channel, IntPtr fstream);

    /// &lt;summary&gt;
    /// Set the position of the stream
    /// &lt;/summary&gt;
    [DllImport(&quot;fmodce.dll&quot;, EntryPoint=&quot;FSOUND_Stream_SetPosition&quot;, SetLastError=true, CharSet=CharSet.Unicode, CallingConvention=CallingConvention.Winapi)]
    public static extern bool SetPosition(IntPtr fstream, UInt32 position);

    /// &lt;summary&gt;
    /// Stop playing the stream
    /// &lt;/summary&gt;
    [DllImport(&quot;fmodce.dll&quot;, EntryPoint=&quot;FSOUND_Stream_Stop&quot;, SetLastError=true, CharSet=CharSet.Unicode, CallingConvention=CallingConvention.Winapi)]
    public static extern bool Stop(IntPtr fstream);

    /// &lt;summary&gt;
    /// Close FMOD and release resources
    /// &lt;/summary&gt;
    [DllImport(&quot;fmodce.dll&quot;, EntryPoint=&quot;FSOUND_Close&quot;, SetLastError=true, CharSet=CharSet.Unicode, CallingConvention=CallingConvention.Winapi)]
    public static extern void Close();
}

}
[/code:mainvg68]

Example Function:

[code:mainvg68]
/// <summary>
/// Example Code that Plays, Stops, and Closes an MP3 File
/// </summary>
private void PlayStopCloseMP3File()
{
// 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/default.asp?url=/library/en-us/dnppcgen/html/ppc_io.asp for more info...
soundStream = FMOD.PPC.GetStream(&quot;\\Program Files\\MorningWake\\test.mp3&quot;);

// 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);

// -----------------------------
// Do Something here...
// -----------------------------

// Stop playing
FMOD.PPC.Stop(soundHandle);

// Release the ressources
FMOD.PPC.Close();

}[/code:mainvg68]

-Dan Krusi (dan at brainwings dot com)

  • You must to post comments
0
0

Here is part 3
[code:ukkzgv0d]
#region FMUSIC API Reference

    #region Callbacks - complete
    #region FMUSIC_CALLBACK
    /// &lt;summary&gt;
    /// FMUSIC_CALLBACK
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;mod&quot;&gt;&lt;/param&gt;
    /// &lt;param name=&quot;param&quot;&gt;&lt;/param&gt;
    public delegate void FMUSIC_CALLBACK
    (
        IntPtr mod,
        byte param
    );
    #endregion
    #endregion

    #region Functions

    #region MUSIC Control Functions - Complete
    #region FMUSIC_FreeSong
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_FreeSong&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FMUSIC_FreeSong
    (
        IntPtr mod
    );
    #endregion
    #region FMUSIC_LoadSong
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_LoadSong&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FMUSIC_LoadSong
    (
        IntPtr name
    );
    #endregion
    #region FMUSIC_LoadSongEx
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_LoadSongEx&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FMUSIC_LoadSongEx
    (
        IntPtr name_or_data,
        int offset,
        int length,
        uint mode,
        IntPtr samplelist,
        int samplelistnum
    );
    #endregion        
    #region FMUSIC_OptimizeChannels
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_OptimizeChannels&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FMUSIC_OptimizeChannels
    (
        IntPtr mod,
        int maxchannels,
        int minvolume
    );
    #endregion        
    #region FMUSIC_PlaySong
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_PlaySong&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FMUSIC_PlaySong
    (
        IntPtr mod
    );
    #endregion        
    #region FMUSIC_SetInstCallback
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_SetInstCallback&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FMUSIC_SetInstCallback
    (
        IntPtr mod,
        FMUSIC_CALLBACK callback,
        int instrument
    );
    #endregion        
    #region FMUSIC_SetLooping
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_SetLooping&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FMUSIC_SetLooping
    (
        IntPtr mod,
        bool looping
    );
    #endregion        
    #region FMUSIC_SetMasterSpeed
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_SetMasterSpeed&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FMUSIC_SetMasterSpeed
    (
        IntPtr mod,
        float speed
    );
    #endregion
    #region FMUSIC_SetMasterVolume
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_SetMasterVolume&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FMUSIC_SetMasterVolume
    (
        IntPtr mod,
        int volume
    );
    #endregion
    #region FMUSIC_SetOrder
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_SetOrder&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FMUSIC_SetOrder
    (
        IntPtr mod,
        int order
    );
    #endregion
    #region FMUSIC_SetOrderCallback
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_SetOrderCallback&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FMUSIC_SetOrderCallback
    (
        IntPtr mod,
        FMUSIC_CALLBACK callback,
        int orderstep
    );
    #endregion        
    #region FMUSIC_SetPanSeperation
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_SetPanSeperation&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FMUSIC_SetPanSeperation
    (
        IntPtr mod,
        float panset
    );
    #endregion        
    #region FMUSIC_SetPaused
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_SetPaused&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FMUSIC_SetPaused
    (
        IntPtr mod,
        bool pause
    );
    #endregion
    #region FMUSIC_SetReverb
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_SetReverb&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FMUSIC_SetReverb
    (
        IntPtr mod,
        bool reverb
    );
    #endregion
    #region FMUSIC_SetRowCallback
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_SetRowCallback&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FMUSIC_SetRowCallback
    (
        IntPtr mod,
        FMUSIC_CALLBACK callback,
        int rowstep
    );
    #endregion
    #region FMUSIC_SetSample
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_SetSample&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FMUSIC_SetSample
    (
        IntPtr mod,
        int sampno,
        IntPtr sptr
    );
    #endregion
    #region FMUSIC_SetUserData
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_SetUserData&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FMUSIC_SetUserData
    (
        IntPtr mod,
        IntPtr userdata
    );
    #endregion
    #region FMUSIC_SetZxxCallback
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_SetZxxCallback&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FMUSIC_SetZxxCallback
    (
        IntPtr mod,
        FMUSIC_CALLBACK callback
    );
    #endregion
    #region FMUSIC_StopAllSongs
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_StopAllSongs&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern void FMUSIC_StopAllSongs
    (
    );
    #endregion
    #region FMUSIC_StopSong
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_StopSong&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FMUSIC_StopSong
    (
        IntPtr mod
    );
    #endregion        
    #endregion

    #region Information functions
    #region FMUSIC_GetBPM
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_GetBPM&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FMUSIC_GetBPM
    (
        IntPtr mod
    );
    #endregion
    #region FMUSIC_GetGlobalVolume
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_GetGlobalVolume&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FMUSIC_GetGlobalVolume
    (
        IntPtr mod
    );
    #endregion        
    #region FMUSIC_GetMasterVolume
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_GetMasterVolume&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FMUSIC_GetMasterVolume
    (
        IntPtr mod
    );
    #endregion        
    #region FMUSIC_GetName
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_GetName&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FMUSIC_GetName
    (
        IntPtr mod
    );
    #endregion        
    #region FMUSIC_GetNumChannels
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_GetNumChannels&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FMUSIC_GetNumChannels
    (
        IntPtr mod
    );
    #endregion        
    #region FMUSIC_GetNumInstruments
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_GetNumInstruments&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FMUSIC_GetNumInstruments
    (
        IntPtr mod
    );
    #endregion        
    #region FMUSIC_GetNumOrders
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_GetNumOrders&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FMUSIC_GetNumOrders
    (
        IntPtr mod
    );
    #endregion        
    #region FMUSIC_GetNumPatterns
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_GetNumPatterns&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FMUSIC_GetNumPatterns
    (
        IntPtr mod
    );
    #endregion        
    #region FMUSIC_GetNumSamples
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_GetNumSamples&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FMUSIC_GetNumSamples
    (
        IntPtr mod
    );
    #endregion        
    #region FMUSIC_GetOpenState
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_GetOpenState&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FMUSIC_GetOpenState
    (
        IntPtr mod
    );
    #endregion
    #region FMUSIC_GetOrder
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_GetOrder&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FMUSIC_GetOrder
    (
        IntPtr mod
    );
    #endregion        
    #region FMUSIC_GetPattern
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_GetPattern&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FMUSIC_GetPattern
    (
        IntPtr mod
    );
    #endregion        
    #region FMUSIC_GetPatternLength
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_GetPatternLength&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FMUSIC_GetPatternLength
    (
        IntPtr mod,
        int orderno
    );
    #endregion        
    #region FMUSIC_GetPaused
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_GetPaused&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FMUSIC_GetPaused
    (
        IntPtr mod
    );
    #endregion        
    #region FMUSIC_GetRealChannel
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_GetRealChannel&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FMUSIC_GetRealChannel
    (
        IntPtr mod,
        int modchannel
    );
    #endregion
    #region FMUSIC_GetRow
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_GetRow&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FMUSIC_GetRow
    (
        IntPtr mod
    );
    #endregion
    #region FMUSIC_GetSample
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_GetSample&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FMUSIC_GetSample
    (
        IntPtr mod,
        int sampno
    );
    #endregion
    #region FMUSIC_GetSpeed
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_GetSpeed&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FMUSIC_GetSpeed
    (
        IntPtr mod
    );
    #endregion
    #region FMUSIC_GetTime
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_GetTime&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FMUSIC_GetTime
    (
        IntPtr mod
    );
    #endregion
    #region FMUSIC_GetType
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_GetType&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern FMUSIC_TYPES FMUSIC_GetType
    (
        IntPtr mod
    );
    #endregion
    #region FMUSIC_GetUserData
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_GetUserData&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FMUSIC_GetUserData
    (
        IntPtr mod
    );
    #endregion
    #region FMUSIC_IsFinished
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_IsFinished&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FMUSIC_IsFinished
    (
        IntPtr mod
    );
    #endregion
    #region FMUSIC_IsPlaying
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FMUSIC_IsPlaying&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FMUSIC_IsPlaying
    (
        IntPtr mod
    );
    #endregion
    #endregion

    #endregion

    #region Enums - complete
    public enum FMUSIC_TYPES
    {
        FMUSIC_TYPE_NONE,
        FMUSIC_TYPE_MOD,        /* Protracker / Fasttracker */
        FMUSIC_TYPE_S3M,        /* ScreamTracker 3 */
        FMUSIC_TYPE_XM,         /* FastTracker 2 */
        FMUSIC_TYPE_IT,         /* Impulse Tracker. */
        FMUSIC_TYPE_MIDI,       /* MIDI file */
        FMUSIC_TYPE_FSB         /* FMOD Sample Bank file */
    };
    #endregion

    #endregion // FMUSIC API Reference

    #region Helper Methods

    /// &lt;summary&gt;
    /// Allocate a IntPtr and copy a C# string into it
    /// MUST use FModFree when done!
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;theString&quot;&gt;&lt;/param&gt;
    /// &lt;returns&gt;&lt;/returns&gt;
    public static IntPtr StringToIntPtr(string theString)
    {
        IntPtr result = IntPtr.Zero;
        byte[] theBytes = new byte[theString.Length + 1];
        int i = 0;
        foreach (char ch in theString)
        {
            theBytes[i++] = (byte)ch;
        }
        theBytes[i++] = 0;
        IntPtr ptr = Marshal.AllocHGlobal(theBytes.Length);
        Marshal.Copy(theBytes, 0, ptr, theBytes.Length);
        return ptr;
    }
    /// &lt;summary&gt;
    /// Copy an unmanged pointer to a C# string
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;p&quot;&gt;&lt;/param&gt;
    /// &lt;returns&gt;&lt;/returns&gt;
    public static string IntPtrToString(IntPtr p)
    {
        string result = &quot;&quot;;
        int i = 0;
        byte b = 0;
        do
        {
            b = Marshal.ReadByte(p, i++);
            if (b != 0)
            {
                result += (char)b;
            }
        } while (b != 0);
        return result;
    }
    /// &lt;summary&gt;
    /// Copy an unmanged pointer to a C# string with a maximum length
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;p&quot;&gt;&lt;/param&gt;
    /// &lt;param name=&quot;length&quot;&gt;&lt;/param&gt;
    /// &lt;returns&gt;&lt;/returns&gt;
    public static string IntPtrToString(IntPtr p, int length)
    {
        string result = &quot;&quot;;
        int i = 0;
        byte b = 0;
        do
        {
            b = Marshal.ReadByte(p, i++);
            if (b != 0)
            {
                result += (char)b;
            }
        } while ((b != 0) &amp;&amp; (i &lt; length));
        return result;
    }
    /// &lt;summary&gt;
    /// Free an InPtr allocated from StringToIntPtr
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;p&quot;&gt;&lt;/param&gt;
    /// &lt;returns&gt;&lt;/returns&gt;
    public static void FMODFree(IntPtr p)
    {
        Marshal.FreeHGlobal(p);
    }
    #endregion
}

}
[/code:ukkzgv0d]

  • You must to post comments
0
0

[code:276bkd9q]byte[] filenamebytes = System.Text.Encoding.Default.GetBytes(filename+null);[/code:276bkd9q]

This only works sometimes. I presume that the intention of the construct "filename+null" is to add a null character to the end of the string. This is necessary as FSOUND_Stream_Open is expecting a null terminated filename. However, this construct does not do this. (The length of the string "filename+null" is identical to the length of filename itself)

The end result is that FSOUND_Stream_Open gets a file name that is only by chance null terminated. On my pocket PC with .NET version 2, the filename would happen to be null terminated depending on its length.

The correct code is:
[code:276bkd9q]byte[] filenameBytes = System.Text.Encoding.Default.GetBytes(filename + ‘\0’); [/code:276bkd9q]

(I’m not going to say how long it took me to track that down)

Cheers
Ronny

  • You must to post comments
0
0

Hi PaulB.

I’ve tested your code, but it does not play the mp3.

You can give an example, please.

I use C# in Visual Studio 2005 and a smartphone with WinCE_5.

Thanks

  • You must to post comments
0
0

Hi, does anyone knows what i should do to solve this problem:

A managed MissingMethodException
occurred at Application::Run+0x1a

Application::Run+0x1a
Form1::Main+0xa

  • You must to post comments
0
0

[quote="dankrusi":1ssqk62i]Dear C# PocketPC Developers…[/quote:1ssqk62i]
[b:1ssqk62i]dankrusi[/b:1ssqk62i] Hi, I do not speak English.
Use your code. Everything is working, but leaking memory. Help.

  • You must to post comments
0
0

The MissingMethodException probably means that a DLL specified in the interop declaration cannot be found. Or, the DLL can be found, but it does not contain the specified function.

Are you sure that the FMOD DLL is in a location where the system can find it? (I presume FMOD as this is a FMOD forum, but it could be any other DLL that you are trying to access using interop). One suggestion would be having the appropriate fmodce.dll file in the same directory as the application itself. Otherwise in the Windows system directory.

One problem, is that the error message you have given does not say what it was that the system was trying to find. This is perhaps because the interop functions that are trying to execute, are being executed in the form load routine. I would suggest taking it out of the form load routine, and explicitly calling each routine individually, until you find the one that causes the exception.

Cheers
Ronny

  • You must to post comments
0
0

Hi, to begin with I’m quite newbie with programming, so please forgive me if I sound stupid:)

Well I use visual studio 2005 and I created a FMOD.cs that holds the c# wrapper. Then in my form1.cs I create a button containing your run codes:

||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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 <!-- m --><a class="postlink" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnppcgen/html/ppc_io.asp">http://msdn.microsoft.com/library/defau ... ppc_io.asp</a><!-- m --> 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);

        // -----------------------------
        // Do Something here...
        // -----------------------------

        // Stop playing
       FMOD.PPC.Stop(soundHandle);

        // Release the ressources
        FMOD.PPC.Close();

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

The point was to test whether it will run and playback the mp3 file. However to my great frustation i got this error:

  • $exception {“Can’t find PInvoke DLL ‘fmodce.dll’.”} System.Exception {System.MissingMethodException}

Yes, I have put the fmodce.dll both in th /bin and sourcecode folders.
Could anyone please help this newbie? Thank you so much.

BTW; Im using ncf 2.0.

  • You must to post comments
0
0

Could somebody please add to the wrapper the methods for FMUSIC for C# (WinCE)? I’m a newbie that doesn’t understand how to write a wrapper for an API.

Thank you for your help.
-Timothy

  • You must to post comments
0
0

Hi Nibbana,

Are you using the correct version of fmodce.dll? There are many versions, which include a build for emulators. Make sure that your bin direcotory includes the correct version – if you are using a emulator, place the emulator version in bin. If you are testing on your device, then make sure the device version is in bin.

Another thing you might want to check: make sure you are using a ‘Mobile Device’ project, not a regular Windows project…

  • You must to post comments
0
0

I’ve added this but I’m not sure if I’m doing this right still…as it doesn’t work.

Could someone please do a check on at least just my wrapper portion?

[code:22kxzomk]/// <summary>
/// FMOD Music Load
/// </summary>
[DllImport("fmodce.dll", EntryPoint = "FMUSIC_LoadSong", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Winapi)]
public static extern int FMUSIC_LoadSong(string name);

    /// &lt;summary&gt; 
    /// FMOD Music Play
    /// &lt;/summary&gt; 
    [DllImport(&quot;fmodce.dll&quot;, EntryPoint = &quot;FMUSIC_PlaySong&quot;, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Winapi)]
    public static extern bool FMUSIC_PlaySong(int fmodule);

    /// &lt;summary&gt; 
    /// FMOD Music Stop
    /// &lt;/summary&gt; 
    [DllImport(&quot;fmodce.dll&quot;, EntryPoint = &quot;FMUSIC_StopSong&quot;, SetLastError = true, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Winapi)]
    public static extern bool FMUSIC_StopSong(IntPtr fstream);[/code:22kxzomk]
  • You must to post comments
0
0

Sorry I’m Korean

I can’t English well.

Help Me ~ Kind Develop Friends..

===========================================

soundHandle = FMOD.PPC.Open(soundStream, 0x100, 0, 0);

debugging result
soundHandle = null

No Compile Error, Runtime Error

But After Open, soundHandle has not no value

so no sound…. –;

why ?

My Dev Env
1. VS 2003 .NET CF (c#)
2. EMUL : PPC2002
3. USE FMOD DLL : FMOD 3.75 wce3/x86/fmodce.dll -> 293 kb
4. Use Mp3 Spec
File Size – 3,301,376
Play Time : 3 min 26 sec
Type : Mpeg 1.0 Layer 3 128 kbs 7913 Frame 44100Hz, Stereo

Please help me…..

  • You must to post comments
0
0

Thanks heaps!!! Damn… how long time have I spent on this shit thing! =P

  • You must to post comments
0
0

test VS 2005 ppc 2003

soundHandle is not null

so correctly operate….

why In dev2003 .net CF soundhandle is null…

My souce code below…..

private void PlayStopCloseMP3File()
{
// Declare our handles
IntPtr soundStream;
IntPtr soundHandle;

// Initialize fmod with mixrate equal to 44.1kHz

try
{
Init(44100, 16, 0);
}
catch(MissingMethodException ex)
{
// Error Processing
MessageBox.Show(ex.Message.ToString());
}

// Initialize the handle with the track file. 
// Note that you must provide the full Pocket PC path. See     <!-- m --><a class="postlink" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnppcgen/html/ppc_io.asp">http://msdn.microsoft.com/library/defau ... ppc_io.asp</a><!-- m --> for more info... 
soundStream = GetStream(@"\Program Files\RunMp3_ARM4\test.mp3"); 

// Open the stream in Normal mode, which is combination of Mono sound, 16 bits, Signed          
soundHandle = Open(soundStream, (int)FSOUND_MODE.FSOUND_MONO | (int)FSOUND_MODE.FSOUND_16BITS | (int)FSOUND_MODE.FSOUND_SIGNED, 0, 0);

// Start playing 
Play(0, soundHandle); 

// ----------------------------- 
// Do Something here... 
// ----------------------------- 

// Stop playing 
Stop(soundHandle); 

// Release the ressources 
Close_Fmod(); 

}

  • You must to post comments
0
0

Hi ,

Any one tell me how to import fmodce.dll

Regards,
venkat.

  • You must to post comments
0
0

Thanks for Fast Reply ^^;

check return value of FSOUND_Stream_Open : value is 0

check FSOUND_GetError : value is 2

In My PC

VS 2003 PPC 2002 Emulator can not play MP3 by media player

I Think only wav sound is possible….IN EMUL PPC 2002..

Because VS 2005 PPC 2003 Emulator can play mp3 by media player…

Brett.

In VS 2003 .net CF / PPC 2002 Emulator, Can I play MP3 ?

It’s Possible or Impissible…

I Want to Know originally possibility.

Bye Brett. THanks FMOD

  • You must to post comments
0
0

[quote="venkat":1eiss3gj]Hi ,

Any one tell me how to import fmodce.dll

Regards,
venkat.[/quote:1eiss3gj]

You don’t need to import fmodce.dll to use it. Just follow the instructions and it should work. For more help have a look at http://52.88.2.202/forum/viewtopic.php?t=4877

Hope it helps

  • You must to post comments
0
0

Works great, but i have a problem. I have Wave Files on SD-Card.
1.wav
2.wav
3.wav
….
45.wav
46.wav

The Routine plays perfekt until File 11.wav. After that, there will be no Sound. Before File 11.wav it works great. 10.wav works perfekt.

If i rename 11.wav to sf11.wav it works. but then 10.wav did not work.

The Filenames are static, so i could not do the mistake in this code-section. It seems, that in this routine must be an error:

public static IntPtr GetStream(string filename)
{
// Get the filename in bytes
byte[] filenamebytes = System.Text.Encoding.Default.GetBytes(filename+null);

        // Get a handle depending on which framework we are using 
        GCHandle hfile = GCHandle.Alloc(filenamebytes, GCHandleType.Pinned); 
        if (Environment.Version.Major == 1) return new IntPtr(hfile.AddrOfPinnedObject().ToInt32()+4); 
        else return hfile.AddrOfPinnedObject(); 
    } 

Who could help?

Thanks

  • You must to post comments
0
0

If anyone is still using this I am creating the entire C# wrapper

[b:2ib0b0tb]
Here is the complete FSOUND and FMUSIC wrapper!!!!
[/b:2ib0b0tb]

I added a few helper methods for converting strings to IntPtr and vice versa. chars in C# are unicode meaning 2 bytes. FMOD wants single bytes for a string. You should use the conversions in any function where an IntPtr is a string.

For example opening a file:

[code:2ib0b0tb]
IntPtr name = FMOD.StringToIntPtr(sFileName);
IntPtr SoundHandle = FMOD.FSOUND_Stream_Open(name, FMOD.FSOUND_NORMAL, 0, 0);
FMOD.FMODFree(name);
[/code:2ib0b0tb]

I have tested most but not all of this. If there are questions feel free to ask.

The big thing to remember is that you must Marshal fmods unmanaged memory to C# mananged memory.

You will also need to set VS to allow unsafe code. The reason for this is FMOD uses an array 512 floats in one of its structs. The only way to do that is using the fixed key word in C# which requires unsafe.

here is 3365 lines of wrapper

😆

Paul

[code:2ib0b0tb]
using System;
using System.Collections;
using System.Runtime.InteropServices;

namespace FMOD3
{
public class FMOD
{

if PocketPC

    private const string FMOD_DLL = &quot;fmodce.dll&quot;;

endif

    #region FSOUND API Reference

    #region CallBacks - complete
    #region FSOUND_DSPCALLBACK
    /// &lt;summary&gt;
    /// FSOUND_DSPCALLBACK
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;originalbuffer&quot;&gt;&lt;/param&gt;
    /// &lt;param name=&quot;newbuffer&quot;&gt;&lt;/param&gt;
    /// &lt;param name=&quot;length&quot;&gt;&lt;/param&gt;
    /// &lt;param name=&quot;userdata&quot;&gt;&lt;/param&gt;
    /// &lt;returns&gt;&lt;/returns&gt;
    public delegate IntPtr FSOUND_DSPCALLBACK
    (
        IntPtr originalbuffer,
        IntPtr newbuffer,
        int length,
        IntPtr userdata
    );
    #endregion
    #region FSOUND_STREAMCALLBACK
    /// &lt;summary&gt;
    /// FSOUND_STREAMCALLBACK
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;stream&quot;&gt;&lt;/param&gt;
    /// &lt;param name=&quot;buffer&quot;&gt;&lt;/param&gt;
    /// &lt;param name=&quot;length&quot;&gt;&lt;/param&gt;
    /// &lt;param name=&quot;userdata&quot;&gt;&lt;/param&gt;
    /// &lt;returns&gt;&lt;/returns&gt;
    public delegate IntPtr FSOUND_STREAMCALLBACK
    (
        IntPtr stream,
        IntPtr buffer,
        int length,
        IntPtr userdata
    );
    #endregion
    #region FSOUND_ALLOCCALLBACK
    public delegate IntPtr FSOUND_ALLOCCALLBACK
    (
        uint size
    );
    #endregion
    #region FSOUND_REALLOCCALLBACK
    public delegate IntPtr FSOUND_REALLOCCALLBACK
    (
        IntPtr ptr,
        uint size
    );
    #endregion
    #region FSOUND_FREECALLBACK
    public delegate void FSOUND_FREECALLBACK
    (
        IntPtr ptr
    );
    #endregion
    #region FSOUND_OPENCALLBACK
    public delegate IntPtr FSOUND_OPENCALLBACK
    (
        IntPtr name
    );
    #endregion
    #region FSOUND_CLOSECALLBACK
    public delegate void FSOUND_CLOSECALLBACK
    (
        IntPtr handle
    );
    #endregion
    #region FSOUND_METADATACALLBACK
    public delegate bool FSOUND_METADATACALLBACK
    (
        IntPtr name,
        IntPtr value,
        IntPtr userdata
    );
    #endregion
    #region FSOUND_READCALLBACK
    public delegate bool FSOUND_READCALLBACK
    (
        IntPtr buffer,
        int size,
        IntPtr handle
    );
    #endregion
    #region FSOUND_SEEKCALLBACK
    public delegate bool FSOUND_SEEKCALLBACK
    (
        IntPtr handle,
        int pos,
        char mode
    );
    #endregion
    #region FSOUND_TELLCALLBACK
    public delegate int FSOUND_TELLCALLBACK
    (
        IntPtr fileHandle
    );
    #endregion
    #endregion

    #region Functions

    #region Pre Initialization / Initialization / Enumeration Functions - complete
    #region FSOUND_Close
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Close&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern void FSOUND_Close
    (
    );
    #endregion
    #region FSOUND_File_SetCallbacks
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_File_SetCallbacks&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern void FSOUND_File_SetCallbacks
    (
        FSOUND_OPENCALLBACK useropen,
        FSOUND_CLOSECALLBACK userclose,
        FSOUND_READCALLBACK userread,
        FSOUND_SEEKCALLBACK userseek,
        FSOUND_TELLCALLBACK usertell
    );
    #endregion
    #region FSOUND_Init
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Init&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern Boolean FSOUND_Init
    (
        int mixrate,
        int maxsoftwarechannels,
        uint flags
    );
    #endregion
    #region FSOUND_SetBufferSize
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_SetBufferSize&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern void FSOUND_SetBufferSize
    (
        int len_ms
    );
    #endregion
    #region FSOUND_SetDriver
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_SetDriver&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern void FSOUND_SetDriver
    (
        int driver
    );
    #endregion
    #region FSOUND_SetHWND
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_SetHWND&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern void FSOUND_SetHWND
    (
        IntPtr hwnd
    );
    #endregion
    #region FSOUND_SetMaxHardwareChannels
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_SetMaxHardwareChannels&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_SetMaxHardwareChannels
    (
        int max
    );
    #endregion
    #region FSOUND_SetMemorySystem
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_SetMemorySystem&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_SetMemorySystem
    (
        IntPtr poolmem,
        int poollen,
        FSOUND_ALLOCCALLBACK useralloc,
        FSOUND_REALLOCCALLBACK userrealloc,
        FSOUND_FREECALLBACK userfree
    );
    #endregion
    #region FSOUND_SetMinHardwareChannels
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_SetMinHardwareChannels&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_SetMinHardwareChannels
    (
        int min
    );
    #endregion
    #region FSOUND_SetMixer
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_SetMixer&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern void FSOUND_SetMixer
    (
        FSOUND_MIXERTYPES mixer
    );
    #endregion
    #region FSOUND_SetOutput
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_SetOutput&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern void FSOUND_SetOutput
    (
        FSOUND_OUTPUTTYPES outputtype
    );
    #endregion
    #endregion

    #region Global run-time update functions - complete
    #region FSOUND_SetPanSeperation
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_SetMaxHardwareChannels&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_SetPanSeperation
    (
        float pansep
    );
    #endregion
    #region FSOUND_SetSFXMasterVolume
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_SetSFXMasterVolume&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_SetSFXMasterVolume
    (
        int volume
    );
    #endregion
    #region FSOUND_SetSpeakerMode
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_SetSpeakerMode&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_SetSpeakerMode
    (
        FSOUND_SPEAKERMODES mode
    );
    #endregion
    #region FSOUND_Update
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Update&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Update
    (
    );
    #endregion
    #endregion

    #region Global run-time Information Functions - complete
    #region FSOUND_GetCPUUsage
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetCPUUsage&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern float FSOUND_GetCPUUsage
    (
    );
    #endregion
    #region FSOUND_GetChannelsPlaying
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetChannelsPlaying&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_GetChannelsPlaying
    (
    );
    #endregion
    #region FSOUND_GetDriver
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetDriver&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_GetDriver
    (
    );
    #endregion
    #region FSOUND_GetDriverCaps
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetDriverCaps&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_GetDriverCaps
    (
        int id,
        out int caps
    );
    #endregion
    #region FSOUND_GetDriverName
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetDriverName&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FSOUND_GetDriverName
    (
        int id
    );
    #endregion
    #region FSOUND_GetError
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetError&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern FMOD_ERRORS FSOUND_GetError
    (
    );
    #endregion
    #region FSOUND_GetMaxSamples
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetMaxSamples&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_GetMaxSamples
    (
    );
    #endregion
    #region FSOUND_GetMaxChannels
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetMaxChannels&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_GetMaxChannels
    (
    );
    #endregion
    #region FSOUND_GetMemoryStats
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetMemoryStats&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern void FSOUND_GetMemoryStats
    (
        out uint currentalloced,
        out uint maxalloced
    );
    #endregion
    #region FSOUND_GetNumDrivers
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetNumDrivers&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_GetNumDrivers
    (
    );
    #endregion
    #region FSOUND_GetNumHWChannels
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetNumHWChannels&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_GetNumHWChannels
    (
        out int num2d,
        out int num3d,
        out int totaal
    );
    #endregion
    #region FSOUND_GetOutput
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetOutput&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern FSOUND_OUTPUTTYPES FSOUND_GetOutput
    (
    );
    #endregion
    #region FSOUND_GetOutputHandle
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetOutputHandle&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FSOUND_GetOutputHandle
    (
    );
    #endregion
    #region FSOUND_GetOutputRate
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetOutputRate&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_GetOutputRate
    (
    );
    #endregion
    #region FSOUND_GetSFXMasterVolume
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetSFXMasterVolume&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_GetSFXMasterVolume
    (
    );
    #endregion
    #region FSOUND_GetVersion
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetVersion&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern float FSOUND_GetVersion
    (
    );
    #endregion
    #endregion

    #region Sample Functions - complete
    #region FSOUND_Sample_Alloc
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Sample_Alloc&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FSOUND_Sample_Alloc
    (
        int index,
        int length,
        uint mode,
        int deffreq,
        int defvol,
        int defpan,
        int defpri
    );
    #endregion
    #region FSOUND_Sample_Free
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Sample_Free&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern void FSOUND_Sample_Free
    (
        IntPtr sptr
    );
    #endregion
    #region FSOUND_Sample_Get
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Sample_Get&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FSOUND_Sample_Get
    (
        int nampno
    );
    #endregion
    #region FSOUND_Sample_GetDefaults
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Sample_GetDefaults&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Sample_GetDefaults
    (
        IntPtr sptr,
        out int deffreq,
        out int defvol,
        out int defpan,
        out int defpri
    );
    #endregion
    #region FSOUND_Sample_GetDefaultsEx
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Sample_GetDefaultsEx&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Sample_GetDefaultsEx
    (
        IntPtr sptr,
        out int deffreq,
        out int defvol,
        out int defpan,
        out int defpri,
        out int varfreq,
        out int varvol,
        out int varpan
    );
    #endregion
    #region FSOUND_Sample_GetLength
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Sample_GetLength&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern uint FSOUND_Sample_GetLength
    (
        IntPtr sptr
    );
    #endregion
    #region FSOUND_Sample_GetLoopPoints
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Sample_GetLoopPoints&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Sample_GetLoopPoints
    (
        IntPtr sptr,
        out int loopstart,
        out int loopend
    );
    #endregion
    #region FSOUND_Sample_GetMinMaxDistance
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Sample_GetMinMaxDistance&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Sample_GetMinMaxDistance
    (
        IntPtr sptr,
        out float min,
        out int max
    );
    #endregion
    #region FSOUND_Sample_GetMode
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Sample_GetMode&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern uint FSOUND_Sample_GetMode
    (
        IntPtr sptr
    );
    #endregion
    #region FSOUND_Sample_GetName
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Sample_GetName&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FSOUND_Sample_GetName
    (
        IntPtr sptr
    );
    #endregion
    #region FSOUND_Sample_Load
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Sample_Load&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FSOUND_Sample_Load
    (
        int index,
        IntPtr name_or_data,
        uint inputmode,
        int offset,
        int length
    );
    #endregion
    #region FSOUND_Sample_Lock
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Sample_Lock&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FSOUND_Sample_Lock
    (
        IntPtr sptr,
        int offset,
        int length,
        out IntPtr ptr1,
        out IntPtr ptr2,
        out uint len1,
        out uint len2
    );
    #endregion
    #region FSOUND_Sample_SetDefaults
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Sample_SetDefaults&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Sample_SetDefaults
    (
        IntPtr sptr,
        int deffreq,
        int defvol,
        int defpan,
        int defpri
    );
    #endregion
    #region FSOUND_Sample_SetDefaultsEx
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Sample_SetDefaultsEx&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Sample_SetDefaultsEx
    (
        IntPtr sptr,
        int deffreq,
        int defvol,
        int defpan,
        int defpri,
        int varfreq,
        int varvol,
        int varpan
    );
    #endregion
    #region FSOUND_Sample_SetMaxPlaybacks
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Sample_SetMaxPlaybacks&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Sample_SetMaxPlaybacks
    (
        IntPtr sptr,
        int max
    );
    #endregion
    #region FSOUND_Sample_SetMinMaxDistance
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Sample_SetMinMaxDistance&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Sample_SetMinMaxDistance
    (
        IntPtr sptr,
        float min,
        float max
    );
    #endregion
    #region FSOUND_Sample_SetMode
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Sample_SetMode&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Sample_SetMode
    (
        IntPtr sptr,
        uint mode
    );
    #endregion
    #region FSOUND_Sample_SetLoopPoints
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Sample_SetLoopPoints&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Sample_SetLoopPoints
    (
        IntPtr sptr,
        int loopstart,
        int loopend
    );
    #endregion
    #region FSOUND_Sample_Unlock
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Sample_Unlock&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Sample_Unlock
    (
        IntPtr sptr,
        int offset,
        int length,
        IntPtr ptr1,
        IntPtr ptr2,
        uint len1,
        uint len2
    );
    #endregion
    #region FSOUND_Sample_Upload
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Sample_Upload&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Sample_Upload
    (
        IntPtr sptr,
        IntPtr srcdata,
        uint mode_in
    );
    #endregion
    #endregion

    #region Channel Functions -- complete
    #region FSOUND_PlaySound
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_PlaySound&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_PlaySound
    (
        int channel,
        IntPtr sptr
    );
    #endregion
    #region FSOUND_PlaySoundEx
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_PlaySoundEx&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_PlaySoundEx
    (
        int channel,
        IntPtr sptr,
        IntPtr dspunit,
        bool startpaused
    );
    #endregion
    #region FSOUND_StopSound
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_StopSound&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_StopSound
    (
        int channel
    );
    #endregion
    #region FSOUND_SetFrequency
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_SetFrequency&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_SetFrequency
    (
        int channel,
        int freq
    );
    #endregion
    #region FSOUND_SetLevels
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_SetLevels&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_SetLevels
    (
        int channel,
        int frontleft,
        int center,
        int frontright,
        int backleft,
        int backright,
        int lfe
    );
    #endregion
    #region FSOUND_SetLoopMode
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_SetLoopMode&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_SetLoopMode
    (
        int channel,
        uint loopmode
    );
    #endregion
    #region FSOUND_SetMute
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_SetMute&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_SetMute
    (
        int channel,
        bool mute
    );
    #endregion
    #region FSOUND_SetPan
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_SetPan&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_SetPan
    (
        int channel,
        int pan
    );
    #endregion
    #region FSOUND_SetPaused
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_SetPaused&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_SetPaused
    (
        int channel,
        bool paused
    );
    #endregion
    #region FSOUND_SetPriority
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_SetPriority&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_SetPriority
    (
        int channel,
        int priority
    );
    #endregion
    #region FSOUND_SetReserved
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_SetReserved&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_SetReserved
    (
        int channel,
        bool reserved
    );
    #endregion
    #region FSOUND_SetSurround
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_SetSurround&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_SetSurround
    (
        int channel,
        bool surround
    );
    #endregion
    #region FSOUND_SetVolume
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_SetVolume&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_SetVolume
    (
        int channel,
        int vol
    );
    #endregion
    #region FSOUND_SetVolumeAbsolute
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_SetVolumeAbsolute&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_SetVolumeAbsolute
    (
        int channel,
        int vol
    );
    #endregion
    #region FSOUND_GetVolume
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetVolume&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_GetVolume
    (
        int channel
    );
    #endregion
    #region FSOUND_GetAmplitude
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetAmplitude&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_GetAmplitude
    (
        int channel
    );
    #endregion
    #region FSOUND_3D_SetAttributes
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_3D_SetAttributes&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_3D_SetAttributes
    (
        int channel,
        ref VECTOR pos,
        ref VECTOR vel
    );
    #endregion
    #region FSOUND_3D_SetMinMaxDistance
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_3D_SetMinMaxDistance&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_3D_SetMinMaxDistance
    (
        int channel,
        out float min,
        out float max
    );
    #endregion
    #region FSOUND_SetCurrentPosition
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_SetCurrentPosition&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_SetCurrentPosition
    (
        int channel,
        uint pos
    );
    #endregion
    #region FSOUND_GetCurrentPosition
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetCurrentPosition&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_GetCurrentPosition
    (
        int channel
    );
    #endregion
    #region FSOUND_GetCurrentSample
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetCurrentSample&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FSOUND_GetCurrentSample
    (
        int channel
    );
    #endregion
    #region FSOUND_GetCurrentLevels
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetCurrentLevels&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FSOUND_GetCurrentLevels
    (
        int channel,
        out float l,
        out float r
    );
    #endregion
    #region FSOUND_GetFrequency
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetFrequency&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_GetFrequency
    (
        int channel
    );
    #endregion
    #region FSOUND_GetLoopMode
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetLoopMode&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern uint FSOUND_GetLoopMode
    (
        int channel
    );
    #endregion
    #region FSOUND_GetMixer
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetMixer&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_GetMixer
    (
        int channel
    );
    #endregion
    #region FSOUND_GetMute
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetMute&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_GetMute
    (
        int channel
    );
    #endregion
    #region FSOUND_GetNumSubChannels
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetNumSubChannels&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_GetNumSubChannels
    (
        int channel
    );
    #endregion
    #region FSOUND_GetPan
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetPan&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_GetPan
    (
        int channel
    );
    #endregion
    #region FSOUND_GetPaused
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetPaused&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_GetPaused
    (
        int channel
    );
    #endregion
    #region FSOUND_GetPriority
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetPriority&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_GetPriority
    (
        int channel
    );
    #endregion
    #region FSOUND_GetReserved
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetReserved&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_GetReserved
    (
        int channel
    );
    #endregion
    #region FSOUND_GetSubChannel
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetSubChannel&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_GetSubChannel
    (
        int channel,
        int subchanel
    );
    #endregion
    #region FSOUND_GetSurround
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_GetSurround&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_GetSurround
    (
        int channel
    );
    #endregion
    #region FSOUND_IsPlaying
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_IsPlaying&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_IsPlaying
    (
        int channel
    );
    #endregion
    #region FSOUND_3D_GetAttributes
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_3D_GetAttributes&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_3D_GetAttributes
    (
        int channel,
        out VECTOR pos,
        out VECTOR vel
    );
    #endregion
    #region FSOUND_3D_GetMinMaxDistance
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_3D_GetMinMaxDistance&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_3D_GetMinMaxDistance
    (
        int channel,
        out float min,
        out float max
    );
    #endregion
    #endregion

    #region 3D Sound functions - complete
    #region FSOUND_3D_Listener_GetAttributes
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_3D_Listener_GetAttributes&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern void FSOUND_3D_Listener_GetAttributes
    (
        out float pos,
        out float vel,
        out float fx,
        out float fy,
        out float fz,
        out float tx,
        out float ty,
        out float tz
    );
    #endregion
    #region FSOUND_3D_Listener_SetAttributes
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_3D_Listener_SetAttributes&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern void FSOUND_3D_Listener_SetAttributes
    (
        float pos,
        float vel,
        float fx,
        float fy,
        float fz,
        float tx,
        float ty,
        float tz
    );
    #endregion
    #region FSOUND_3D_Listener_SetCurrent
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_3D_Listener_SetCurrent&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern void FSOUND_3D_Listener_SetCurrent
    (
        int current,
        int numlisteners
    );
    #endregion
    #region FSOUND_3D_SetDistanceFactor
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_3D_SetDistanceFactor&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern void FSOUND_3D_SetDistanceFactor
    (
        float factor
    );
    #endregion
    #region FSOUND_3D_SetDopplerFactor
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_3D_SetDopplerFactor&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern void FSOUND_3D_SetDopplerFactor
    (
        float scale
    );
    #endregion
    #region FSOUND_3D_SetRolloffFactor
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_3D_SetRolloffFactor&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern void FSOUND_3D_SetRolloffFactor
    (
        float factor
    );
    #endregion
    #endregion

    #region Stream Functions - Complete
    #region FSOUND_Stream_AddSyncPoint
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_AddSyncPoint&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FSOUND_Stream_AddSyncPoint
    (
        IntPtr fstream,
        uint pcmoffset,
        IntPtr name
    );
    #endregion
    #region FSOUND_Stream_Close
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_Close&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern void FSOUND_Stream_Close
    (
        IntPtr fstream
    );
    #endregion
    #region FSOUND_Stream_Create
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_Create&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FSOUND_Stream_Create
    (
        FSOUND_STREAMCALLBACK callback,
        int lenbytes,
        uint mode,
        int samplerate,
        IntPtr userdata
    );
    #endregion
    #region FSOUND_Stream_CreateDSP
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_CreateDSP&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FSOUND_Stream_CreateDSP
    (
        IntPtr stream,
        FSOUND_DSPCALLBACK callback,
        int priority,
        IntPtr userdata
    );
    #endregion
    #region FSOUND_Stream_DeleteSyncPoint
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_DeleteSyncPoint&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Stream_DeleteSyncPoint
    (
        IntPtr point
    );
    #endregion
    #region FSOUND_Stream_FindTagField
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_FindTagField&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Stream_FindTagField
    (
        IntPtr stream,
        FSOUND_TAG_FIELD_TYPE type,
        IntPtr name,
        out IntPtr value,
        out int length
    );
    #endregion
    #region FSOUND_Stream_GetLength
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_GetLength&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_Stream_GetLength
    (
        IntPtr fstream
    );
    #endregion
    #region FSOUND_Stream_GetLengthMs
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_GetLengthMs&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_Stream_GetLengthMs
    (
        IntPtr fstream
    );
    #endregion
    #region FSOUND_Stream_GetMode
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_GetMode&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern uint FSOUND_Stream_GetMode
    (
        IntPtr fstream
    );
    #endregion
    #region FSOUND_Stream_GetNumSubStreams
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_GetNumSubStreams&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_Stream_GetNumSubStreams
    (
        IntPtr fstream
    );
    #endregion
    #region FSOUND_Stream_GetNumSyncPoints
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_GetNumSyncPoints&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_Stream_GetNumSyncPoints
    (
        IntPtr fstream
    );
    #endregion
    #region FSOUND_Stream_GetNumTagFields
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_GetNumTagFields&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Stream_GetNumTagFields
    (
        IntPtr fstream,
        out int num
    );
    #endregion
    #region FSOUND_Stream_GetOpenState
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_GetOpenState&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_Stream_GetOpenState
    (
        IntPtr fstream
    );
    #endregion
    #region FSOUND_Stream_GetPosition
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_GetPosition&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern UInt32 FSOUND_Stream_GetPosition
    (
        IntPtr fstream
    );
    #endregion
    #region FSOUND_Stream_GetSample
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_GetSample&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FSOUND_Stream_GetSample
    (
        IntPtr fstream
    );
    #endregion
    #region FSOUND_Stream_GetSyncPoint
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_GetSyncPoint&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FSOUND_Stream_GetSyncPoint
    (
        IntPtr fstream,
        int index
    );
    #endregion
    #region FSOUND_Stream_GetSyncPointInfo
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_GetSyncPointInfo&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FSOUND_Stream_GetSyncPointInfo
    (
        IntPtr point,
        out uint pcmoffset
    );
    #endregion
    #region FSOUND_Stream_GetTagField
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_GetTagField&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Stream_GetTagField
    (
        IntPtr fstream,
        int num,
        out FSOUND_TAG_FIELD_TYPE type,
        out IntPtr name,
        out IntPtr value,
        out int length
    );
    #endregion
    #region FSOUND_Stream_GetTime
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_GetTime&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_Stream_GetTime
    (
        IntPtr fstream
    );
    #endregion
    #region FSOUND_Stream_Net_GetBufferProperties
    [Obsolete]
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_Net_GetBufferProperties&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Stream_Net_GetBufferProperties
    (
        out int buffersize,
        out int prebuffer_percent,
        out int rebuffer_percent
    );
    #endregion
    #region FSOUND_Stream_Net_GetLastServerStatus
    [Obsolete]
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_Net_GetLastServerStatus&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FSOUND_Stream_Net_GetLastServerStatus
    (
    );
    #endregion
    #region FSOUND_Stream_Net_GetStatus
    [Obsolete]
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_Net_GetStatus&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FSOUND_Stream_Net_GetStatus
    (
        IntPtr stream,
        out int status,
        out int bufferused,
        out int bitrate,
        out uint flags
    );
    #endregion
    #region FSOUND_Stream_Net_SetBufferProperties
    [Obsolete]
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_Net_SetBufferProperties&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FSOUND_Stream_Net_SetBufferProperties
    (
        int buffersize,
        int prebuffer_percent,
        int rebuffer_percent
    );
    #endregion
    #region FSOUND_Stream_Net_SetMetadataCallback
    [Obsolete]
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_Net_SetMetadataCallback&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FSOUND_Stream_Net_SetMetadataCallback
    (
        IntPtr stream,
        FSOUND_METADATACALLBACK callback,
        IntPtr userdata
    );
    #endregion
    #region FSOUND_Stream_Net_SetProxy
    [Obsolete]
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_Net_SetProxy&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Stream_Net_SetProxy
    (
        IntPtr proxy
    );
    #endregion
    #region FSOUND_Stream_Open
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_Open&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FSOUND_Stream_Open
    (
        IntPtr data,
        uint mode,
        int offset,
        int length
    );
    #endregion
    #region FSOUND_Stream_Play
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_Play&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_Stream_Play
    (
        int channel,
        IntPtr fstream
    );
    #endregion
    #region FSOUND_Stream_PlayEx
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_Play&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_Stream_Play
    (
        int channel,
        IntPtr fstream,
        IntPtr dspunit,
        bool paused
    );
    #endregion
    #region FSOUND_Stream_SetBufferSize
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_SetBufferSize&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Stream_SetBufferSize
    (
        int ms
    );
    #endregion
    #region FSOUND_Stream_SetEndCallback
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_SetEndCallback&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Stream_SetEndCallback
    (
        IntPtr stream,
        FSOUND_STREAMCALLBACK callback,
        IntPtr userdata
    );
    #endregion
    #region FSOUND_Stream_SetLoopCount
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_SetLoopCount&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Stream_SetLoopCount
    (
        IntPtr stream,
        int count
    );
    #endregion
    #region FSOUND_Stream_SetLoopPoints
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_SetLoopPoints&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Stream_SetLoopPoints
    (
        IntPtr stream,
        uint loopstart,
        uint loopend
    );
    #endregion
    #region FSOUND_Stream_SetMode
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_SetMode&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Stream_Setmode
    (
        IntPtr stream,
        uint mode
    );
    #endregion
    #region FSOUND_Stream_SetPosition
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_SetPosition&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Stream_SetPosition
    (
        IntPtr fstream,
        UInt32 position
    );
    #endregion
    #region FSOUND_Stream_SetSubStream
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_SetSubStream&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Stream_SetSubStream
    (
        IntPtr fstream,
        int index
    );
    #endregion
    #region FSOUND_Stream_SetSubStreamSentence
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_SetSubStreamSentence&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Stream_SetSubStreamSentence
    (
        IntPtr fstream,
        IntPtr sentencelist,
        int numitems
    );
    #endregion
    #region FSOUND_Stream_SetSyncCallback
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_SetSyncCallback&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Stream_SetSyncCallback
    (
        IntPtr fstream,
        FSOUND_STREAMCALLBACK callback,
        IntPtr userData
    );
    #endregion
    #region FSOUND_Stream_SetTime
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_SetTime&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Stream_SetTime
    (
        IntPtr fstream,
        int ms
    );
    #endregion
    #region FSOUND_Stream_Stop
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Stream_Stop&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Stream_Stop
    (
        IntPtr fstream
    );
    #endregion
    #endregion

[/code:2ib0b0tb]

  • You must to post comments
0
0

Doesn’t work for me at all, I’m getting FMOD_ERR_FILE_FORMAT from FMOD.PPC.GetError() after having called

soundHandle = FMOD.PPC.Open(soundStream, 0x100, 0, 0);

Appears that the call to FMOD.PPC.GetStream(file) succeeds because soundStream is set to a non 0 value. The mp3 file I’m trying to play can be played fine with any other play on the pocket pc …

Any idea how I can further debug the cause of this ?

thx,
Gringo

  • You must to post comments
0
0

here is part 2

[code:3awnbbm1]
#region CD Functions – complete
#region FSOUND_CD_GetNumTracks

if PocketPC

    [Obsolete]

endif

    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_CD_GetNumTracks&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_CD_GetNumTracks
    (
        byte drive  // not char -- char is 2 bytes unicode
    );
    #endregion
    #region FSOUND_CD_GetPaused

if PocketPC

    [Obsolete]

endif

    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_CD_GetPaused&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_CD_GetPaused
    (
        byte drive  // not char -- char is 2 bytes unicode
    );
    #endregion
    #region FSOUND_CD_GetTrack

if PocketPC

    [Obsolete]

endif

    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_CD_GetTrack&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_CD_GetTrack
    (
        byte drive  // not char -- char is 2 bytes unicode
    );
    #endregion
    #region FSOUND_CD_GetTrackLength

if PocketPC

    [Obsolete]

endif

    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_CD_GetTrackLength&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_CD_GetTrackLength
    (
        byte drive,  // not char -- char is 2 bytes unicode
        int track
    );
    #endregion
    #region FSOUND_CD_GetTrackTime

if PocketPC

    [Obsolete]

endif

    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_CD_GetTrackTime&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_CD_GetTrackTime
    (
        byte drive,  // not char -- char is 2 bytes unicode
        int track
    );
    #endregion
    #region FSOUND_CD_GetVolume

if PocketPC

    [Obsolete]

endif

    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_CD_GetVolume&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_CD_GetVolume
    (
        byte drive  // not char -- char is 2 bytes unicode
    );
    #endregion
    #region FSOUND_CD_OpenTray

if PocketPC

    [Obsolete]

endif

    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_CD_OpenTray&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_CD_OpenTray
    (
        byte drive,  // not char -- char is 2 bytes unicode
        bool open
    );
    #endregion
    #region FSOUND_CD_Play

if PocketPC

    [Obsolete]

endif

    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_CD_Play&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_CD_Play
    (
        byte drive,  // not char -- char is 2 bytes unicode
        int track
    );
    #endregion
    #region FSOUND_CD_SetPaused

if PocketPC

    [Obsolete]

endif

    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_CD_SetPaused&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_CD_SetPaused
    (
        byte drive,  // not char -- char is 2 bytes unicode
        bool paused
    );
    #endregion
    #region FSOUND_CD_SetPlayMode

if PocketPC

    [Obsolete]

endif

    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_CD_SetPlayMode&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern void FSOUND_CD_SetPlayMode
    (
        byte drive,  // not char -- char is 2 bytes unicode
        byte mode
    );
    #endregion
    #region FSOUND_CD_SetTrackTime

if PocketPC

    [Obsolete]

endif

    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_CD_SetTrackTime&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_CD_SetTrackTime
    (
        byte drive,  // not char -- char is 2 bytes unicode
        uint ms
    );
    #endregion
    #region FSOUND_CD_SetVolume

if PocketPC

    [Obsolete]

endif

    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_CD_SetVolume&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_CD_SetVolume
    (
        byte drive,  // not char -- char is 2 bytes unicode
        int volume
    );
    #endregion
    #region FSOUND_CD_Stop

if PocketPC

    [Obsolete]

endif

    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_CD_Stop&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_CD_Stop
    (
        byte drive  // not char -- char is 2 bytes unicode
    );
    #endregion
    #endregion

    #region DSP Functions - complete
    #region FSOUND_DSP_ClearMixBuffer
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_DSP_ClearMixBuffer&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern void FSOUND_DSP_ClearMixBuffer
    (
    );
    #endregion
    #region FSOUND_DSP_Create
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_DSP_Create&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FSOUND_DSP_Create
    (
        FSOUND_DSPCALLBACK calback,
        int priority,
        IntPtr userdata
    );
    #endregion
    #region FSOUND_DSP_Free
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_DSP_Free&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern void FSOUND_DSP_Free
    (
        IntPtr unit
    );
    #endregion
    #region FSOUND_DSP_SetActive
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_DSP_SetActive&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern void FSOUND_DSP_SetActive
    (
        IntPtr unit,
        bool active
    );
    #endregion
    #region FSOUND_DSP_GetActive
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_DSP_GetActive&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_DSP_GetActive
    (
        IntPtr unit
    );
    #endregion
    #region FSOUND_DSP_GetBufferLength
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_DSP_GetBufferLength&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_DSP_GetBufferLength
    (
    );
    #endregion
    #region FSOUND_DSP_GetBufferLengthTotal
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_DSP_GetBufferLengthTotal&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_DSP_GetBufferLengthTotal
    (
    );
    #endregion
    #region FSOUND_DSP_SetPriority
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_DSP_SetPriority&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern void FSOUND_DSP_SetPriority
    (
        IntPtr unit,
        int priority
    );
    #endregion
    #region FSOUND_DSP_GetClearUnit
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_DSP_GetClearUnit&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FSOUND_DSP_SetPriority
    (
    );
    #endregion
    #region FSOUND_DSP_GetClipAndCopyUnit
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_DSP_GetClipAndCopyUnit&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FSOUND_DSP_GetClipAndCopyUnit
    (
    );
    #endregion
    #region FSOUND_DSP_GetMusicUnit
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_DSP_GetMusicUnit&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FSOUND_DSP_GetMusicUnit
    (
    );
    #endregion
    #region FSOUND_DSP_GetSFXUnit
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_DSP_GetSFXUnit&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FSOUND_DSP_GetSFXUnit
    (
    );
    #endregion
    #region FSOUND_DSP_GetFFTUnit
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_DSP_GetFFTUnit&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FSOUND_DSP_GetFFTUnit
    (
    );
    #endregion
    #region FSOUND_DSP_GetSpectrum
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_DSP_GetSpectrum&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FSOUND_DSP_GetSpectrum
    (
    );
    #endregion        
    #region FSOUND_DSP_MixBuffers
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_DSP_MixBuffers&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_DSP_MixBuffers
    (
        IntPtr destbuffer,
        IntPtr srcbuffer,
        int len,
        int freq,
        int vol,
        int pan,
        uint mode
    );
    #endregion                
    #endregion

    #region FX Functions - Complete
    #region FSOUND_FX_Disable
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_FX_Disable&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_FX_Disable
    (
        int channel
    );
    #endregion                
    #region FSOUND_FX_Enable
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_FX_Enable&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_FX_Enable
    (
        int channel,
        FSOUND_FX_MODES fxtype
    );
    #endregion                
    #region FSOUND_FX_SetChorus
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_FX_SetChorus&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_FX_SetChorus
    (
        int fxid,
        float WetDryMix,
        float Depth,
        float Feedback,
        float Frequency,
        int Waveform,
        float Delay,
        int Phase
    );
    #endregion                
    #region FSOUND_FX_SetCompressor
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_FX_SetCompressor&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_FX_SetCompressor
    (
        int fxid,
        float Gain,
        float Attack,
        float Release,
        float Threshold,
        float Ratio,
        float Predelay
    );
    #endregion                
    #region FSOUND_FX_SetDistortion
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_FX_SetDistortion&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_FX_SetDistortion
    (
        int fxid,
        float Gain,
        float Edge,
        float PostEQCenterFrequency,
        float PostEQBandwidth,
        float PreLowpassCutoff
    );
    #endregion
    #region FSOUND_FX_SetEcho
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_FX_SetEcho&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_FX_SetEcho
    (
        int fxid,
        float WetDryMix,
        float Feedback,
        float LeftDelay,
        float RightDelay,
        int PanDelay
    );
    #endregion
    #region FSOUND_FX_SetFlanger
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_FX_SetFlanger&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_FX_SetFlanger
    (
        int fxid,
        float WetDryMix,
        float Depth,
        float Feedback,
        float Frequency,
        int Waveform,
        float Delay,
        int Phase
    );
    #endregion
    #region FSOUND_FX_SetGargle
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_FX_SetGargle&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_FX_SetGargle
    (
        int fxid,
        int RateHz,
        int WaveShape
    );
    #endregion
    #region FSOUND_FX_SetI3DL2Reverb
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_FX_SetI3DL2Reverb&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_FX_SetI3DL2Reverb
    (
        int fxid,
        int Room,
        int RoomHF,
        float RoomRolloffFactor,
        float DecayTime,
        float DecayHFRatio,
        int Reflections,
        float ReflectionsDelay,
        int Reverb,
        float ReverbDelay,
        float Diffusion,
        float Density,
        float HFReference
    );
    #endregion
    #region FSOUND_FX_SetParamEQ
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_FX_SetParamEQ&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_FX_SetParamEQ
    (
        int fxid,
        float Center,
        float Bandwidth,
        float Gain
    );
    #endregion
    #region FSOUND_FX_SetWavesReverb
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_FX_SetWavesReverb&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_FX_SetWavesReverb
    (
        int fxid,
        float InGain,
        float ReverbMix,
        float ReverbTime,
        float HighFreqRTRatio
    );
    #endregion
    #endregion

    #region Recording Functions - Complete
    #region FSOUND_Record_GetDriver
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Record_GetDriver&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_Record_GetDriver
    (
    );
    #endregion
    #region FSOUND_Record_GetDriverName
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Record_GetDriverName&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern IntPtr FSOUND_Record_GetDriverName
    (
        int id
    );
    #endregion
    #region FSOUND_Record_GetNumDrivers
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Record_GetNumDrivers&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_Record_GetNumDrivers
    (
    );
    #endregion
    #region FSOUND_Record_GetPosition
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Record_GetPosition&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern int FSOUND_Record_GetPosition
    (
    );
    #endregion
    #region FSOUND_Record_SetDriver
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Record_SetDriver&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Record_SetDriver
    (
        int driver
    );
    #endregion
    #region FSOUND_Record_StartSample
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Record_StartSample&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Record_StartSample
    (
        IntPtr sptr,
        bool loop
    );
    #endregion
    #region FSOUND_Record_Stop
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Record_Stop&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Record_Stop
    (
    );
    #endregion
    #endregion

    #region Reverb Functions - Complete
    #region FSOUND_Reverb_SetProperties
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Reverb_SetProperties&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Reverb_SetProperties
    (
        ref FSOUND_REVERB_PROPERTIES props
    );
    #endregion
    #region FSOUND_Reverb_GetProperties
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Reverb_GetProperties&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Reverb_GetProperties
    (
        out FSOUND_REVERB_PROPERTIES props
    );
    #endregion
    #region FSOUND_Reverb_SetChannelProperties
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Reverb_SetChannelProperties&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Reverb_SetChannelProperties
    (
        int channel,
        ref FSOUND_REVERB_CHANNELPROPERTIES props
    );
    #endregion
    #region FSOUND_Reverb_GetChannelProperties
    [DllImport(FMOD_DLL,
    EntryPoint = &quot;FSOUND_Reverb_GetChannelProperties&quot;,
    SetLastError = true,
    CharSet = CharSet.Unicode,
    CallingConvention = CallingConvention.Winapi)]
    public static extern bool FSOUND_Reverb_GetChannelProperties
    (
        int channel,
        out FSOUND_REVERB_CHANNELPROPERTIES props
    );
    #endregion
    #endregion

    #endregion // Functions

    #region Constants - complete
    #region FSOUND_CAPS
    public const uint FSOUND_CAPS_HARDWARE = 0x1; /* This driver supports hardware accelerated 3d sound. */
    public const uint FSOUND_CAPS_EAX2 = 0x2; /* This driver supports EAX 2 reverb */
    public const uint FSOUND_CAPS_EAX3 = 0x10; /* This driver supports EAX 3 reverb */
    #endregion
    #region FSOUND_CDPLAYMODES
    public const uint FSOUND_CD_PLAYCONTINUOUS = 0;   /* Starts from the current track and plays to end of CD. */
    public const uint FSOUND_CD_PLAYONCE = 1;       /* Plays the specified track then stops. */
    public const uint FSOUND_CD_PLAYLOOPED = 2;   /* Plays the specified track looped, forever until stopped manually. */
    public const uint FSOUND_CD_PLAYRANDOM = 3;   /* Plays tracks in random order */
    #endregion
    #region FSOUND_DSP_PRIORITIES
    public const uint FSOUND_DSP_DEFAULTPRIORITY_CLEARUNIT  =  0;       /* DSP CLEAR unit - done first */
    public const uint FSOUND_DSP_DEFAULTPRIORITY_SFXUNIT = 100;     /* DSP SFX unit - done second */
    public const uint FSOUND_DSP_DEFAULTPRIORITY_MUSICUNIT = 200;     /* DSP MUSIC unit - done third */
    public const uint FSOUND_DSP_DEFAULTPRIORITY_USER = 300;     /* User priority, use this as reference for your own DSP units */
    public const uint FSOUND_DSP_DEFAULTPRIORITY_FFTUNIT =  900;     /* This reads data for FSOUND_DSP_GetSpectrum, so it comes after user units */
    public const uint FSOUND_DSP_DEFAULTPRIORITY_CLIPANDCOPYUNIT = 1000;   /* DSP CLIP AND COPY unit - last */
    #endregion
    #region FSOUND_MODES
    public const uint FSOUND_LOOP_OFF = 0x00000001; /* For non looping samples. */
    public const uint FSOUND_LOOP_NORMAL = 0x00000002; /* For forward looping samples. */
    public const uint FSOUND_LOOP_BIDI = 0x00000004; /* For bidirectional looping samples. (no effect if in hardware). */
    public const uint FSOUND_8BITS = 0x00000008; /* For 8 bit samples. */
    public const uint FSOUND_16BITS = 0x00000010; /* For 16 bit samples. */
    public const uint FSOUND_MONO = 0x00000020; /* For mono samples. */
    public const uint FSOUND_STEREO = 0x00000040; /* For stereo samples. */
    public const uint FSOUND_UNSIGNED = 0x00000080; /* For user created source data containing unsigned samples. */
    public const uint FSOUND_SIGNED = 0x00000100; /* For user created source data containing signed data. */
    public const uint FSOUND_DELTA = 0x00000200; /* For user created source data stored as delta values. */
    public const uint FSOUND_IT214 = 0x00000400; /* For user created source data stored using IT214 compression. */
    public const uint FSOUND_IT215 = 0x00000800; /* For user created source data stored using IT215 compression. */
    public const uint FSOUND_HW3D = 0x00001000; /* Attempts to make samples use 3d hardware acceleration. (if the card supports it) */
    public const uint FSOUND_2D = 0x00002000; /* Tells software (not hardware) based sample not to be included in 3d processing. */
    public const uint FSOUND_STREAMABLE = 0x00004000; /* For a streamimg sound where you feed the data to it. */
    public const uint FSOUND_LOADMEMORY = 0x00008000; /* &quot;name&quot; will be interpreted as a pointer to data for streaming and samples. */
    public const uint FSOUND_LOADRAW = 0x00010000; /* Will ignore file format and treat as raw pcm. */
    public const uint FSOUND_MPEGACCURATE = 0x00020000; /* For const  int FSOUND_Stream_Open - for accurate const  int FSOUND_Stream_GetLengthMs/const  int FSOUND_Stream_SetTime. WARNING, see const  int FSOUND_Stream_Open for inital opening time performance issues. */
    public const uint FSOUND_FORCEMONO = 0x00040000; /* For forcing stereo streams and samples to be mono - needed if using const  int FSOUND_HW3D and stereo data - incurs a small speed hit for streams */
    public const uint FSOUND_HW2D = 0x00080000; /* 2D hardware sounds. allows hardware specific effects */
    public const uint FSOUND_ENABLEFX = 0x00100000; /* Allows DX8 FX to be played back on a sound. Requires DirectX 8 - Note these sounds cannot be played more than once, be 8 bit, be less than a certain size, or have a changing frequency */
    public const uint FSOUND_MPEGHALFRATE = 0x00200000; /* For FMODCE only - decodes mpeg streams using a lower quality decode, but faster execution */
    public const uint FSOUND_IMAADPCM = 0x00400000; /* Contents are stored compressed as IMA ADPCM */
    public const uint FSOUND_VAG = 0x00800000; /* For PS2 only - Contents are compressed as Sony VAG format */
    public const uint FSOUND_NONBLOCKING = 0x01000000; /* For const  int FSOUND_Stream_Open/FMUSIC_LoadSong - Causes stream or music to open in the background and not block the foreground app. See const  int FSOUND_Stream_GetOpenState or FMUSIC_GetOpenState to determine when it IS ready. */
    public const uint FSOUND_GCADPCM = 0x02000000; /* For Gamecube only - Contents are compressed as Gamecube DSP-ADPCM format */
    public const uint FSOUND_MULTICHANNEL = 0x04000000; /* For PS2 and Gamecube only - Contents are interleaved into a multi-channel (more than stereo) format */
    public const uint FSOUND_USECORE0 = 0x08000000; /* For PS2 only - Sample/Stream is forced to use hardware voices 00-23 */
    public const uint FSOUND_USECORE1 = 0x10000000; /* For PS2 only - Sample/Stream is forced to use hardware voices 24-47 */
    public const uint FSOUND_LOADMEMORYIOP = 0x20000000; /* For PS2 only - &quot;name&quot; will be interpreted as a pointer to data for streaming and samples. The address provided will be an IOP address */
    public const uint FSOUND_IGNORETAGS = 0x40000000; /* Skips id3v2 etc tag checks when opening a stream, to reduce seek/read overhead when opening files (helps with CD performance) */
    public const uint FSOUND_STREAM_NET = 0x80000000; /* Specifies an internet stream */
    public const uint FSOUND_NORMAL = (FSOUND_16BITS | FSOUND_SIGNED | FSOUND_MONO);
    #endregion
    #region FSOUND_REVERB_PRESETS

    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_OFF = new FSOUND_REVERB_PROPERTIES(0, 7.5f, 1.00f, -10000, -10000, 0, 1.00f, 1.00f, 1.0f, -2602, 0.007f, 0.0f, 0.0f, 0.0f, 200, 0.011f, 0.0f, 0.0f, 0.0f, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 0.0f, 0.0f, 0x33f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_GENERIC = new FSOUND_REVERB_PROPERTIES(0, 7.5f, 1.00f, -1000, -100, 0, 1.49f, 0.83f, 1.0f, -2602, 0.007f, 0.0f, 0.0f, 0.0f, 200, 0.011f, 0.0f, 0.0f, 0.0f, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_PADDEDCELL = new FSOUND_REVERB_PROPERTIES(1, 1.4f, 1.00f, -1000, -6000, 0, 0.17f, 0.10f, 1.0f, -1204, 0.001f, 0.0f, 0.0f, 0.0f, 207, 0.002f, 0.0f, 0.0f, 0.0f, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_ROOM = new FSOUND_REVERB_PROPERTIES(2, 1.9f, 1.00f, -1000, -454, 0, 0.40f, 0.83f, 1.0f, -1646, 0.002f, 0.0f, 0.0f, 0.0f, 53, 0.003f, 0.0f, 0.0f, 0.0f, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_BATHROOM = new FSOUND_REVERB_PROPERTIES(3, 1.4f, 1.00f, -1000, -1200, 0, 1.49f, 0.54f, 1.0f, -370, 0.007f, 0.0f, 0.0f, 0.0f, 1030, 0.011f, 0.0f, 0.0f, 0.0f, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 60.0f, 0x3f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_LIVINGROOM = new FSOUND_REVERB_PROPERTIES(4, 2.5f, 1.00f, -1000, -6000, 0, 0.50f, 0.10f, 1.0f, -1376, 0.003f, 0.0f, 0.0f, 0.0f, -1104, 0.004f, 0.0f, 0.0f, 0.0f, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_STONEROOM = new FSOUND_REVERB_PROPERTIES(5, 11.6f, 1.00f, -1000, -300, 0, 2.31f, 0.64f, 1.0f, -711, 0.012f, 0.0f, 0.0f, 0.0f, 83, 0.017f, 0.0f, 0.0f, 0.0f, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_AUDITORIUM = new FSOUND_REVERB_PROPERTIES(6, 21.6f, 1.00f, -1000, -476, 0, 4.32f, 0.59f, 1.0f, -789, 0.020f, 0.0f, 0.0f, 0.0f, -289, 0.030f, 0.0f, 0.0f, 0.0f, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_CONCERTHALL = new FSOUND_REVERB_PROPERTIES(7, 19.6f, 1.00f, -1000, -500, 0, 3.92f, 0.70f, 1.0f, -1230, 0.020f, 0.0f, 0.0f, 0.0f, -2, 0.029f, 0.0f, 0.0f, 0.0f, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_CAVE = new FSOUND_REVERB_PROPERTIES(8, 14.6f, 1.00f, -1000, 0, 0, 2.91f, 1.30f, 1.0f, -602, 0.015f, 0.0f, 0.0f, 0.0f, -302, 0.022f, 0.0f, 0.0f, 0.0f, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x1f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_ARENA = new FSOUND_REVERB_PROPERTIES(9, 36.2f, 1.00f, -1000, -698, 0, 7.24f, 0.33f, 1.0f, -1166, 0.020f, 0.0f, 0.0f, 0.0f, 16, 0.030f, 0.0f, 0.0f, 0.0f, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_HANGAR = new FSOUND_REVERB_PROPERTIES(10, 50.3f, 1.00f, -1000, -1000, 0, 10.05f, 0.23f, 1.0f, -602, 0.020f, 0.0f, 0.0f, 0.0f, 198, 0.030f, 0.0f, 0.0f, 0.0f, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_CARPETTEDHALLWAY = new FSOUND_REVERB_PROPERTIES(11, 1.9f, 1.00f, -1000, -4000, 0, 0.30f, 0.10f, 1.0f, -1831, 0.002f, 0.0f, 0.0f, 0.0f, -1630, 0.030f, 0.0f, 0.0f, 0.0f, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_HALLWAY = new FSOUND_REVERB_PROPERTIES(12, 1.8f, 1.00f, -1000, -300, 0, 1.49f, 0.59f, 1.0f, -1219, 0.007f, 0.0f, 0.0f, 0.0f, 441, 0.011f, 0.0f, 0.0f, 0.0f, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_STONECORRIDOR = new FSOUND_REVERB_PROPERTIES(13, 13.5f, 1.00f, -1000, -237, 0, 2.70f, 0.79f, 1.0f, -1214, 0.013f, 0.0f, 0.0f, 0.0f, 395, 0.020f, 0.0f, 0.0f, 0.0f, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_ALLEY = new FSOUND_REVERB_PROPERTIES(14, 7.5f, 0.30f, -1000, -270, 0, 1.49f, 0.86f, 1.0f, -1204, 0.007f, 0.0f, 0.0f, 0.0f, -4, 0.011f, 0.0f, 0.0f, 0.0f, 0.125f, 0.95f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_FOREST = new FSOUND_REVERB_PROPERTIES(15, 38.0f, 0.30f, -1000, -3300, 0, 1.49f, 0.54f, 1.0f, -2560, 0.162f, 0.0f, 0.0f, 0.0f, -229, 0.088f, 0.0f, 0.0f, 0.0f, 0.125f, 1.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 79.0f, 100.0f, 0x3f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_CITY = new FSOUND_REVERB_PROPERTIES(16, 7.5f, 0.50f, -1000, -800, 0, 1.49f, 0.67f, 1.0f, -2273, 0.007f, 0.0f, 0.0f, 0.0f, -1691, 0.011f, 0.0f, 0.0f, 0.0f, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 50.0f, 100.0f, 0x3f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_MOUNTAINS = new FSOUND_REVERB_PROPERTIES(17, 100.0f, 0.27f, -1000, -2500, 0, 1.49f, 0.21f, 1.0f, -2780, 0.300f, 0.0f, 0.0f, 0.0f, -1434, 0.100f, 0.0f, 0.0f, 0.0f, 0.250f, 1.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 27.0f, 100.0f, 0x1f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_QUARRY = new FSOUND_REVERB_PROPERTIES(18, 17.5f, 1.00f, -1000, -1000, 0, 1.49f, 0.83f, 1.0f, -10000, 0.061f, 0.0f, 0.0f, 0.0f, 500, 0.025f, 0.0f, 0.0f, 0.0f, 0.125f, 0.70f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_PLAIN = new FSOUND_REVERB_PROPERTIES(19, 42.5f, 0.21f, -1000, -2000, 0, 1.49f, 0.50f, 1.0f, -2466, 0.179f, 0.0f, 0.0f, 0.0f, -1926, 0.100f, 0.0f, 0.0f, 0.0f, 0.250f, 1.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 21.0f, 100.0f, 0x3f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_PARKINGLOT = new FSOUND_REVERB_PROPERTIES(20, 8.3f, 1.00f, -1000, 0, 0, 1.65f, 1.50f, 1.0f, -1363, 0.008f, 0.0f, 0.0f, 0.0f, -1153, 0.012f, 0.0f, 0.0f, 0.0f, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x1f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_SEWERPIPE = new FSOUND_REVERB_PROPERTIES(21, 1.7f, 0.80f, -1000, -1000, 0, 2.81f, 0.14f, 1.0f, 429, 0.014f, 0.0f, 0.0f, 0.0f, 1023, 0.021f, 0.0f, 0.0f, 0.0f, 0.250f, 0.00f, 0.25f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 80.0f, 60.0f, 0x3f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_UNDERWATER = new FSOUND_REVERB_PROPERTIES(22, 1.8f, 1.00f, -1000, -4000, 0, 1.49f, 0.10f, 1.0f, -449, 0.007f, 0.0f, 0.0f, 0.0f, 1700, 0.011f, 0.0f, 0.0f, 0.0f, 0.250f, 0.00f, 1.18f, 0.348f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x3f);

    /* Non I3DL2 presets */

    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_DRUGGED = new FSOUND_REVERB_PROPERTIES(23, 1.9f, 0.50f, -1000, 0, 0, 8.39f, 1.39f, 1.0f, -115, 0.002f, 0.0f, 0.0f, 0.0f, 985, 0.030f, 0.0f, 0.0f, 0.0f, 0.250f, 0.00f, 0.25f, 1.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x1f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_DIZZY = new FSOUND_REVERB_PROPERTIES(24, 1.8f, 0.60f, -1000, -400, 0, 17.23f, 0.56f, 1.0f, -1713, 0.020f, 0.0f, 0.0f, 0.0f, -613, 0.030f, 0.0f, 0.0f, 0.0f, 0.250f, 1.00f, 0.81f, 0.310f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x1f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_PSYCHOTIC = new FSOUND_REVERB_PROPERTIES(25, 1.0f, 0.50f, -1000, -151, 0, 7.56f, 0.91f, 1.0f, -626, 0.020f, 0.0f, 0.0f, 0.0f, 774, 0.030f, 0.0f, 0.0f, 0.0f, 0.250f, 0.00f, 4.00f, 1.000f, -5.0f, 5000.0f, 250.0f, 0.0f, 100.0f, 100.0f, 0x1f);

    /* PlayStation 2 and PlayStation Portable only presets */

    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_PS2_ROOM = new FSOUND_REVERB_PROPERTIES(1, 0, 0, 0, 0, 0, 0.0f, 0.0f, 0.0f, 0, 0.000f, 0.0f, 0.0f, 0.0f, 0, 0.000f, 0.0f, 0.0f, 0.0f, 0.000f, 0.00f, 0.00f, 0.000f, 0.0f, 0000.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0x31f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_PS2_STUDIO_A = new FSOUND_REVERB_PROPERTIES(2, 0, 0, 0, 0, 0, 0.0f, 0.0f, 0.0f, 0, 0.000f, 0.0f, 0.0f, 0.0f, 0, 0.000f, 0.0f, 0.0f, 0.0f, 0.000f, 0.00f, 0.00f, 0.000f, 0.0f, 0000.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0x31f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_PS2_STUDIO_B = new FSOUND_REVERB_PROPERTIES(3, 0, 0, 0, 0, 0, 0.0f, 0.0f, 0.0f, 0, 0.000f, 0.0f, 0.0f, 0.0f, 0, 0.000f, 0.0f, 0.0f, 0.0f, 0.000f, 0.00f, 0.00f, 0.000f, 0.0f, 0000.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0x31f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_PS2_STUDIO_C = new FSOUND_REVERB_PROPERTIES(4, 0, 0, 0, 0, 0, 0.0f, 0.0f, 0.0f, 0, 0.000f, 0.0f, 0.0f, 0.0f, 0, 0.000f, 0.0f, 0.0f, 0.0f, 0.000f, 0.00f, 0.00f, 0.000f, 0.0f, 0000.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0x31f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_PS2_HALL = new FSOUND_REVERB_PROPERTIES(5, 0, 0, 0, 0, 0, 0.0f, 0.0f, 0.0f, 0, 0.000f, 0.0f, 0.0f, 0.0f, 0, 0.000f, 0.0f, 0.0f, 0.0f, 0.000f, 0.00f, 0.00f, 0.000f, 0.0f, 0000.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0x31f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_PS2_SPACE = new FSOUND_REVERB_PROPERTIES(6, 0, 0, 0, 0, 0, 0.0f, 0.0f, 0.0f, 0, 0.000f, 0.0f, 0.0f, 0.0f, 0, 0.000f, 0.0f, 0.0f, 0.0f, 0.000f, 0.00f, 0.00f, 0.000f, 0.0f, 0000.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0x31f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_PS2_ECHO = new FSOUND_REVERB_PROPERTIES(7, 0, 0, 0, 0, 0, 0.0f, 0.0f, 0.0f, 0, 0.000f, 0.0f, 0.0f, 0.0f, 0, 0.000f, 0.0f, 0.0f, 0.0f, 0.000f, 0.00f, 0.00f, 0.000f, 0.0f, 0000.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0x31f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_PS2_DELAY = new FSOUND_REVERB_PROPERTIES(8, 0, 0, 0, 0, 0, 0.0f, 0.0f, 0.0f, 0, 0.000f, 0.0f, 0.0f, 0.0f, 0, 0.000f, 0.0f, 0.0f, 0.0f, 0.000f, 0.00f, 0.00f, 0.000f, 0.0f, 0000.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0x31f);
    static public readonly FSOUND_REVERB_PROPERTIES FSOUND_PRESET_PS2_PIPE = new FSOUND_REVERB_PROPERTIES(9, 0, 0, 0, 0, 0, 0.0f, 0.0f, 0.0f, 0, 0.000f, 0.0f, 0.0f, 0.0f, 0, 0.000f, 0.0f, 0.0f, 0.0f, 0.000f, 0.00f, 0.00f, 0.000f, 0.0f, 0000.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0x31f);
    #endregion
    #region FSOUND_MISC_VALUES
    public const int FSOUND_FREE             = -1;      /* value to play on any free channel, or to allocate a sample in a free sample slot. */
    public const int FSOUND_UNMANAGED        = -2;      /* value to allocate a sample that is NOT managed by FSOUND or placed in a sample slot. */
    public const int FSOUND_ALL              = -3;      /* for a channel index , this flag will affect ALL channels available!  Not supported by every function. */
    public const int FSOUND_STEREOPAN        = -1;      /* value for FSOUND_SetPan so that stereo sounds are not played at half volume.  See FSOUND_SetPan for more on this. */
    public const int FSOUND_SYSTEMCHANNEL    = -1000;   /* special 'channel' ID for all channel based functions that want to alter the global FSOUND software mixing output channel */
    public const int FSOUND_SYSTEMSAMPLE = -1000;   /* special 'sample' ID for all sample based functions that want to alter the global FSOUND software mixing output sample */
    #endregion
    #endregion  // constants

    #region Enums
    public enum FMOD_ERRORS
    {
        FMOD_ERR_NONE,  /* No errors */
        FMOD_ERR_BUSY,  /* Cannot call this command after FSOUND_Init. Call FSOUND_Close first. */
        FMOD_ERR_UNINITIALIZED,     /* This command failed because FSOUND_Init or FSOUND_SetOutput was not called */
        FMOD_ERR_INIT,  /* Error initializing output device. */
        FMOD_ERR_ALLOCATED,     /* Error initializing output device, but more specifically, the output device is already in use and cannot be reused. */
        FMOD_ERR_PLAY,  /* Playing the sound failed. */
        FMOD_ERR_OUTPUT_FORMAT,     /* Soundcard does not support the features needed for this soundsystem (16bit stereo output) */
        FMOD_ERR_COOPERATIVELEVEL,  /* Error setting cooperative level for hardware. */
        FMOD_ERR_CREATEBUFFER,  /* Error creating hardware sound buffer. */
        FMOD_ERR_FILE_NOTFOUND,     /* File not found */
        FMOD_ERR_FILE_FORMAT,   /* Unknown file format */
        FMOD_ERR_FILE_BAD,  /* Error loading file */
        FMOD_ERR_MEMORY,    /* Not enough memory or resources */
        FMOD_ERR_VERSION,   /* The version number of this file format is not supported */
        FMOD_ERR_INVALID_PARAM,     /* An invalid parameter was passed to this function */
        FMOD_ERR_NO_EAX,    /* Tried to use an EAX command on a non EAX enabled channel or output. */
        FMOD_ERR_CHANNEL_ALLOC,     /* Failed to allocate a new channel */
        FMOD_ERR_RECORD,    /* Recording is not supported on this machine */
        FMOD_ERR_MEDIAPLAYER,   /* Windows Media Player not installed so cannot play wma or use internet streaming. */
        FMOD_ERR_CDDEVICE,  /* An error occured trying to open the specified CD device */
    }
    public enum FSOUND_TAG_FIELD_TYPE
    {
        FSOUND_TAGFIELD_VORBISCOMMENT, /* A vorbis comment */
        FSOUND_TAGFIELD_ID3V1, /* Part of an ID3v1 tag */
        FSOUND_TAGFIELD_ID3V2, /* An ID3v2 frame */
        FSOUND_TAGFIELD_SHOUTCAST, /* A SHOUTcast header line */
        FSOUND_TAGFIELD_ICECAST, /* An Icecast header line */
        FSOUND_TAGFIELD_ASF, /* An Advanced Streaming Format header line */
    }
    public enum FSOUND_MIXERTYPES
    {
        FSOUND_MIXER_AUTODETECT, /* CE/PS2/GC Only - Non interpolating/low quality mixer. */
        FSOUND_MIXER_BLENDMODE, /* Removed / obsolete. */
        FSOUND_MIXER_MMXP5, /* Removed / obsolete. */
        FSOUND_MIXER_MMXP6, /* Removed / obsolete. */
        FSOUND_MIXER_QUALITY_AUTODETECT,
        FSOUND_MIXER_QUALITY_FPU, /* Win32/Linux only - Interpolating/volume ramping FPU mixer. */
        FSOUND_MIXER_QUALITY_MMXP5, /* Win32/Linux only - Interpolating/volume ramping P5 MMX mixer. */
        FSOUND_MIXER_QUALITY_MMXP6, /* Win32/Linux only - Interpolating/volume ramping ppro+ MMX mixer. */
        FSOUND_MIXER_MONO, /* CE/PS2/GC only - MONO non interpolating/low quality mixer. For speed*/
        FSOUND_MIXER_QUALITY_MONO, /* CE/PS2/GC only - MONO Interpolating mixer. For speed */
        FSOUND_MIXER_MAX,
    };
    public enum FSOUND_OUTPUTTYPES
    {
        FSOUND_OUTPUT_NOSOUND, /* NoSound driver, all calls to this succeed but do nothing. */
        FSOUND_OUTPUT_WINMM, /* Windows Multimedia driver. */
        FSOUND_OUTPUT_DSOUND, /* DirectSound driver. You need this to get EAX2 or EAX3 support, or FX api support. */
        FSOUND_OUTPUT_A3D, /* A3D driver. */
        FSOUND_OUTPUT_OSS, /* Linux/Unix OSS (Open Sound System) driver, i.e. the kernel sound drivers. */
        FSOUND_OUTPUT_ESD, /* Linux/Unix ESD (Enlightment Sound Daemon) driver. */
        FSOUND_OUTPUT_ALSA, /* Linux Alsa driver. */
        FSOUND_OUTPUT_ASIO, /* Low latency ASIO driver */
        FSOUND_OUTPUT_XBOX, /* Xbox driver */
        FSOUND_OUTPUT_PS2, /* PlayStation 2 driver */
        FSOUND_OUTPUT_MAC, /* Mac SoundManager driver */
        FSOUND_OUTPUT_GC, /* Gamecube driver */
        FSOUND_OUTPUT_PSP, /* PlayStation Portable driver */
        FSOUND_OUTPUT_NOSOUND_NONREALTIME, /* This is the same as nosound, but the sound generation is driven by FSOUND_Update */
    };
    public enum FSOUND_SPEAKERMODES
    {
        FSOUND_SPEAKERMODE_DOLBYDIGITAL, /* Dolby Digital Output (XBOX or PC only). */
        FSOUND_SPEAKERMODE_HEADPHONES, /* The speakers are headphones. */
        FSOUND_SPEAKERMODE_MONO, /* The speakers are monaural. */
        FSOUND_SPEAKERMODE_QUAD, /* The speakers are quadraphonic. */
        FSOUND_SPEAKERMODE_STEREO, /* The speakers are stereo (default value). */
        FSOUND_SPEAKERMODE_SURROUND, /* The speakers are surround sound. */
        FSOUND_SPEAKERMODE_DTS, /* DTS output (XBOX only). */
        FSOUND_SPEAKERMODE_PROLOGIC2, /* Dolby Prologic 2. Playstation 2 and Gamecube only. PlayStation 2 doesnt support interior panning, but supports 48 voices simultaneously. */
        FSOUND_SPEAKERMODE_PROLOGIC2_INTERIOR, /* Dolby Prologic 2. Playstation 2 and Gamecube only. PlayStation 2 does support interior panning, but only supports 24 voices simultaneously. */
    };
    public enum FSOUND_FX_MODES
    {
        FSOUND_FX_CHORUS,
        FSOUND_FX_COMPRESSOR,
        FSOUND_FX_DISTORTION,
        FSOUND_FX_ECHO,
        FSOUND_FX_FLANGER,
        FSOUND_FX_GARGLE,
        FSOUND_FX_I3DL2REVERB,
        FSOUND_FX_PARAMEQ,
        FSOUND_FX_WAVES_REVERB,

        FSOUND_FX_MAX
    };
    #endregion

    #region Structs - complete
    public struct VECTOR
    {
        public float x;
        public float y;
        public float z;
    }
    public unsafe struct SPECTRUM
    {
        public fixed float band[512];
    }
    public struct FSOUND_REVERB_CHANNELPROPERTIES /* MIN     MAX    DEFAULT */
    {
        int Direct;                              /* -10000, 1000,  0,    direct path level (at low and mid frequencies) (WIN32/XBOX) */
        int DirectHF;                            /* -10000, 0,     0,    relative direct path level at high frequencies (WIN32/XBOX) */
        int Room;                                /* -10000, 1000,  0,    room effect level (at low and mid frequencies) (WIN32/XBOX/PS2) */
        int RoomHF;                              /* -10000, 0,     0,    relative room effect level at high frequencies (WIN32/XBOX) */
        int Obstruction;                         /* -10000, 0,     0,    main obstruction control (attenuation at high frequencies)  (WIN32/XBOX) */
        float ObstructionLFRatio;                  /* 0.0,    1.0,   0.0,  obstruction low-frequency level re. main control (WIN32/XBOX) */
        int Occlusion;                           /* -10000, 0,     0,    main occlusion control (attenuation at high frequencies) (WIN32/XBOX) */
        float OcclusionLFRatio;                    /* 0.0,    1.0,   0.25, occlusion low-frequency level re. main control (WIN32/XBOX) */
        float OcclusionRoomRatio;                  /* 0.0,    10.0,  1.5,  relative occlusion control for room effect (WIN32) */
        float OcclusionDirectRatio;                /* 0.0,    10.0,  1.0,  relative occlusion control for direct path (WIN32) */
        int Exclusion;                           /* -10000, 0,     0,    main exlusion control (attenuation at high frequencies) (WIN32) */
        float ExclusionLFRatio;                    /* 0.0,    1.0,   1.0,  exclusion low-frequency level re. main control (WIN32) */
        int OutsideVolumeHF;                     /* -10000, 0,     0,    outside sound cone level at high frequencies (WIN32) */
        float DopplerFactor;                       /* 0.0,    10.0,  0.0,  like DS3D flDopplerFactor but per source (WIN32) */
        float RolloffFactor;                       /* 0.0,    10.0,  0.0,  like DS3D flRolloffFactor but per source (WIN32) */
        float RoomRolloffFactor;                   /* 0.0,    10.0,  0.0,  like DS3D flRolloffFactor but for room effect (WIN32/XBOX) */
        float AirAbsorptionFactor;                 /* 0.0,    10.0,  1.0,  multiplies AirAbsorptionHF member of FSOUND_REVERB_PROPERTIES (WIN32) */
        int Flags;                               /* FSOUND_REVERB_CHANNELFLAGS - modifies the behavior of properties (WIN32) */
    }
    public struct FSOUND_REVERB_PROPERTIES /* MIN     MAX    DEFAULT   DESCRIPTION */
    {                                   
        public uint Environment;            /* 0     , 25    , 0      , sets all listener properties (WIN32/PS2 only) */
        public float EnvSize;                /* 1.0   , 100.0 , 7.5    , environment size in meters (WIN32 only) */
        public float EnvDiffusion;           /* 0.0   , 1.0   , 1.0    , environment diffusion (WIN32/XBOX) */
        public int Room;                   /* -10000, 0     , -1000  , room effect level (at mid frequencies) (WIN32/XBOX/PS2) */
        public int RoomHF;                 /* -10000, 0     , -100   , relative room effect level at high frequencies (WIN32/XBOX) */
        public int RoomLF;                 /* -10000, 0     , 0      , relative room effect level at low frequencies (WIN32 only) */
        public float DecayTime;              /* 0.1   , 20.0  , 1.49   , reverberation decay time at mid frequencies (WIN32/XBOX) */
        public float DecayHFRatio;           /* 0.1   , 2.0   , 0.83   , high-frequency to mid-frequency decay time ratio (WIN32/XBOX) */
        public float DecayLFRatio;           /* 0.1   , 2.0   , 1.0    , low-frequency to mid-frequency decay time ratio (WIN32 only) */
        public int Reflections;            /* -10000, 1000  , -2602  , early reflections level relative to room effect (WIN32/XBOX) */
        public float ReflectionsDelay;       /* 0.0   , 0.3   , 0.007  , initial reflection delay time (WIN32/XBOX) */
        public float  ReflectionsPan0; /*[3];      /*       ,       , [0,0,0], early reflections panning vector (WIN32 only) */
        public float  ReflectionsPan1; /*[3];      /*       ,       , [0,0,0], early reflections panning vector (WIN32 only) */
        public float  ReflectionsPan2; /*[3];      /*       ,       , [0,0,0], early reflections panning vector (WIN32 only) */
        public int Reverb;                 /* -10000, 2000  , 200    , late reverberation level relative to room effect (WIN32/XBOX) */
        public float ReverbDelay;            /* 0.0   , 0.1   , 0.011  , late reverberation delay time relative to initial reflection (WIN32/XBOX) */
        public float  ReverbPan0;           /*       ,       , [0,0,0], late reverberation panning vector (WIN32 only) */
        public float  ReverbPan1;           /*       ,       , [0,0,0], late reverberation panning vector (WIN32 only) */
        public float  ReverbPan2;           /*       ,       , [0,0,0], late reverberation panning vector (WIN32 only) */
        public float EchoTime;               /* .075  , 0.25  , 0.25   , echo time (WIN32/PS2 only.  PS2 = Delay time for ECHO/DELAY modes only) */
        public float EchoDepth;              /* 0.0   , 1.0   , 0.0    , echo depth (WIN32/PS2 only.  PS2 = Feedback level for ECHO mode only) */
        public float ModulationTime;         /* 0.04  , 4.0   , 0.25   , modulation time (WIN32 only) */
        public float ModulationDepth;        /* 0.0   , 1.0   , 0.0    , modulation depth (WIN32 only) */
        public float AirAbsorptionHF;        /* -100  , 0.0   , -5.0   , change in level per meter at high frequencies (WIN32 only) */
        public float HFReference;            /* 1000.0, 20000 , 5000.0 , reference high frequency (hz) (WIN32/XBOX) */
        public float LFReference;            /* 20.0  , 1000.0, 250.0  , reference low frequency (hz) (WIN32 only) */
        public float RoomRolloffFactor;      /* 0.0   , 10.0  , 0.0    , like FSOUND_3D_SetRolloffFactor but for room effect (WIN32/XBOX) */
        public float Diffusion;              /* 0.0   , 100.0 , 100.0  , Value that controls the echo density in the late reverberation decay. (XBOX only) */
        public float Density;                /* 0.0   , 100.0 , 100.0  , Value that controls the modal density in the late reverberation decay (XBOX only) */
        public uint Flags;                  /* FSOUND_REVERB_FLAGS - modifies the behavior of above properties (WIN32/PS2 only) */

        public FSOUND_REVERB_PROPERTIES
            (
            uint _Environment,
            float _EnvSize,
            float _EnvDiffusion,
            int _Room,
            int _RoomHF,
            int _RoomLF,
            float _DecayTime,
            float _DecayHFRatio,
            float _DecayLFRatio,
            int _Reflections,
            float _ReflectionsDelay,
            float _ReflectionsPan0,
            float _ReflectionsPan1,
            float _ReflectionsPan2,
            int _Reverb,
            float _ReverbDelay,
            float  _ReverbPan0,
            float _ReverbPan1,
            float _ReverbPan2,
            float _EchoTime,
            float _EchoDepth,
            float _ModulationTime,
            float _ModulationDepth,
            float _AirAbsorptionHF,
            float _HFReference,
            float _LFReference,
            float _RoomRolloffFactor,
            float _Diffusion,
            float _Density,
            uint _Flags
            )
            {
                Environment = _Environment;
                EnvSize = _EnvSize;
                EnvDiffusion = _EnvDiffusion;
                Room = _Room;
                RoomHF = _RoomHF;
                RoomLF = _RoomLF;
                DecayTime = _DecayTime;
                DecayHFRatio = _DecayHFRatio;
                DecayLFRatio = _DecayLFRatio;
                Reflections = _Reflections;
                ReflectionsDelay = _ReflectionsDelay;
                ReflectionsPan0 = _ReflectionsPan0;
                ReflectionsPan1 = _ReflectionsPan1;
                ReflectionsPan2 = _ReflectionsPan2;
                Reverb = _Reverb;
                ReverbDelay = _ReverbDelay;
                ReverbPan0 = _ReverbPan0;
                ReverbPan1 = _ReverbPan1;
                ReverbPan2 = _ReverbPan2;
                EchoTime = _EchoTime;
                EchoDepth = _EchoDepth;
                ModulationTime = _ModulationTime;
                ModulationDepth = _ModulationDepth;
                AirAbsorptionHF = _AirAbsorptionHF;
                HFReference = _HFReference;
                LFReference = _LFReference;
                RoomRolloffFactor = _RoomRolloffFactor;
                Diffusion = _Diffusion;
                Density = _Density;
                Flags = _Flags;
            }
    };
    #endregion

    #endregion  // FSOUND API Reference

[/code:3awnbbm1]

  • You must to post comments
Showing 1 - 20 of 21 results
Your Answer

Please first to submit.