Quantcast
Channel: naudio Work Item Rss Feed
Viewing all articles
Browse latest Browse all 738

Commented Unassigned: Unsopported WaveFormat WasapiLoopbackCapture [16458]

$
0
0
Hi, i have an error when the proyect starts to record, this is the code:

WasapiLoopbackCapture waveInStream;
WaveFileWriter writer;
bool isRecording = false;

private void cmdRecord_Click(object sender, System.EventArgs e)
{
if (isRecording == false)
{
this.Enabled = false;
saveFileDialog1.Filter = "Wav Files (*.wav)|*.wav";
DialogResult result = saveFileDialog1.ShowDialog();
if (result == DialogResult.OK)
{
string RutaAGrabar = saveFileDialog1.FileName;
waveInStream = new WasapiLoopbackCapture();
writer = new WaveFileWriter(RutaAGrabar, waveInStream.WaveFormat);
waveInStream.DataAvailable += new System.EventHandler<WaveInEventArgs>(waveInStream_DataAvailable);
waveInStream.StartRecording();// the error is here,
isRecording = true;
}
this.Enabled = true;
}
else
{
waveInStream.StopRecording();
waveInStream.Dispose();
waveInStream = null;
writer.Close();
writer = null;
IsRecording = false;
}
}
void waveInStream_DataAvailable(object sender, WaveInEventArgs e)
{
writer.WriteData(e.Buffer, 0, e.BytesRecorded);
}
thanks for any help
Comments: that's unusual. What OS are you using?

Viewing all articles
Browse latest Browse all 738

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>