예제 #1
0
 void OnDataAvailable(object sender, WaveInEventArgs e)
 {
     if (InvokeRequired)
     {
         BeginInvoke(new EventHandler <WaveInEventArgs>(OnDataAvailable), sender, e);
     }
     else
     {
         Decoder.AddDataInRealTime(AudioUtils.ConvertBuffer(e.Buffer, 1, 16));
     }
 }
예제 #2
0
 private void OnDataAvailable(object sender, WaveInEventArgs e)
 {
     if (InvokeRequired)
     {
         BeginInvoke(new EventHandler <WaveInEventArgs>(OnDataAvailable), sender, e);
     }
     else
     {
         _audioDecoder.AddDataInRealTime(AudioUtils.ConvertBuffer(e.Buffer, _waveIn.WaveFormat.Channels, _waveIn.WaveFormat.BitsPerSample));
     }
 }