+++ /dev/null
-using System;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-using System.Runtime.InteropServices;\r
-using System.IO;\r
-using System.Diagnostics;\r
-using System.Threading;\r
-\r
-\r
-namespace FDK\r
-{\r
- public unsafe class Cogg : SoundDecoder\r
- {\r
- static byte[] FOURCC = Encoding.ASCII.GetBytes( "SggO" ); // OggS の little endian\r
-\r
-\r
- #region [ SoundDecoder.dll インポート(ogg 関連)]\r
- //-----------------\r
- [DllImport( "SoundDecoder.dll" )]\r
- private static extern void oggClose( int nHandle );\r
- [DllImport( "SoundDecoder.dll" )]\r
- private static extern int oggDecode( int nHandle, IntPtr pDest, uint szDestSize, int bLoop );\r
- [DllImport( "SoundDecoder.dll" )]\r
- private static extern int oggGetFormat( int nHandle, ref CWin32.WAVEFORMATEX wfx );\r
- [DllImport( "SoundDecoder.dll" )]\r
- private static extern uint oggGetTotalPCMSize( int nHandle );\r
- [DllImport( "SoundDecoder.dll" )]\r
- private static extern int oggOpen( string fileName );\r
- [DllImport( "SoundDecoder.dll" )]\r
- private static extern int oggSeek( int nHandle, uint dwPosition );\r
- //-----------------\r
- #endregion\r
-\r
-\r
- public override int Open( string filename )\r
- {\r
- return oggOpen( filename );\r
- }\r
- public override int GetFormat( int nHandle, ref CWin32.WAVEFORMATEX wfx )\r
- {\r
- return oggGetFormat( nHandle, ref wfx );\r
- }\r
- public override uint GetTotalPCMSize( int nHandle )\r
- {\r
- return oggGetTotalPCMSize( nHandle );\r
- }\r
- public override int Seek( int nHandle, uint dwPosition )\r
- {\r
- return oggSeek( nHandle, dwPosition );\r
- }\r
- public override int Decode( int nHandle, IntPtr pDest, uint szDestSize, int bLoop )\r
- {\r
- return oggDecode( nHandle, pDest, szDestSize, bLoop );\r
- }\r
-\r
- public override void Close( int nHandle )\r
- {\r
- oggClose( nHandle );\r
- }\r
-\r
- }\r
-}\r