2 using System.Collections.Generic;
4 using System.Runtime.InteropServices;
6 using System.Diagnostics;
7 using System.Threading;
12 public unsafe class Cmp3 : SoundDecoder
14 // static byte[] FOURCC = Encoding.ASCII.GetBytes( "SggO" ); // OggS の little endian
17 #region [ SoundDecoder.dll インポート(mpr 関連)]
19 [DllImport( "SoundDecoder.dll" )]
20 private static extern void mp3Close( int nHandle );
21 [DllImport( "SoundDecoder.dll" )]
22 private static extern int mp3Decode( int nHandle, IntPtr pDest, uint szDestSize, int bLoop );
23 [DllImport( "SoundDecoder.dll" )]
24 private static extern int mp3GetFormat( int nHandle, ref CWin32.WAVEFORMATEX wfx );
25 [DllImport( "SoundDecoder.dll" )]
26 private static extern uint mp3GetTotalPCMSize( int nHandle );
27 [DllImport( "SoundDecoder.dll" )]
28 private static extern int mp3Open( string fileName );
29 [DllImport( "SoundDecoder.dll" )]
30 private static extern int mp3Seek( int nHandle, uint dwPosition );
35 public override int Open( string filename )
37 return mp3Open( filename );
39 public override int GetFormat( int nHandle, ref CWin32.WAVEFORMATEX wfx )
41 return mp3GetFormat( nHandle, ref wfx );
43 public override uint GetTotalPCMSize( int nHandle )
45 return mp3GetTotalPCMSize( nHandle );
47 public override int Seek( int nHandle, uint dwPosition )
49 return mp3Seek( nHandle, dwPosition );
51 public override int Decode( int nHandle, IntPtr pDest, uint szDestSize, int bLoop )
53 return mp3Decode( nHandle, pDest, szDestSize, bLoop );
56 public override void Close( int nHandle )