public static byte[] Serialize(VoiceCapturedEventArgs source)
 {
     byte[] Rezult;
     using (MemoryStream ms = new MemoryStream())
     {
         BinaryFormatter bf = new BinaryFormatter();
         bf.Serialize(ms, source);
         Rezult = ms.ToArray();
         ms.Flush();
     }
     return Rezult;
 }
示例#2
0
 private void OnWaveRecorded(IntPtr ptrData, int iSize, WaveFormat format)
 {
     VoiceCapturedEventArgs e = new VoiceCapturedEventArgs();// {Date = DateTime.Now, Format = format};
     e.Source = new byte[iSize];
     Marshal.Copy(ptrData, e.Source, 0, iSize);
     if (WaveRecorded!=null) //Igor 08.31
     WaveRecorded(this,e);
 }