void OnDataAvailable(object sender, WaveInEventArgs e) { if (InvokeRequired) { BeginInvoke(new EventHandler <WaveInEventArgs>(OnDataAvailable), sender, e); } else { Decoder.AddDataInRealTime(AudioUtils.ConvertBuffer(e.Buffer, 1, 16)); } }
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)); } }