Example #1
0
 public WaveBuffer(uint dwSize)
 {
     this.Data         = new byte[(int)dwSize];
     this.dataHandle   = GCHandle.Alloc(Data, GCHandleType.Pinned);
     this.bufferHandle = GCHandle.Alloc(this);
     Win32.WaveHeader waveHeader = new Win32.WaveHeader
     {
         lpData         = this.dataHandle.AddrOfPinnedObject(),
         dwBufferLength = (uint)this.Data.Length,
         dwUser         = GCHandle.ToIntPtr(this.bufferHandle)
     };
     this.pHeader = Marshal.AllocHGlobal(Win32.WaveHeader.SizeOfWaveHeader);
     Marshal.StructureToPtr(waveHeader, this.pHeader, true);
 }
Example #2
0
 public static extern int waveInUnprepareHeader(IntPtr hwi, ref Win32.WaveHeader pwh, int cbwh);
Example #3
0
 public static extern int waveInAddBuffer(IntPtr hwi, ref Win32.WaveHeader pwh, int cbwh);
Example #4
0
 public static extern int waveOutWrite(IntPtr hwo, ref Win32.WaveHeader pwh, int cbwh);
Example #5
0
 public static extern int waveOutPrepareHeader(IntPtr hwo, ref Win32.WaveHeader pwh, int cbwh);
Example #6
0
 public static WaveBuffer FromWaveHeader(Win32.WaveHeader header)
 {
     return((WaveBuffer)GCHandle.FromIntPtr(header.dwUser).Target);
 }