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

Commented Unassigned: Wrong BitsPerSample with WasapiLoopbackCapture [16401]

$
0
0
Hello

I have a 24 bits per sample / 192kHz sound board and I am using the Wasapi Loopback Capture method to get data from it.

When I print out the capabilities of the board, it shows 32 bits per sample instead of 24 bits per sample...

```
private void button2_Click(object sender, EventArgs e)
{
waveIn = new WasapiLoopbackCapture();
waveIn.DataAvailable += OnDataAvailable;
waveIn.RecordingStopped += OnRecordingStopped;
waveIn.StartRecording();

Console.WriteLine(waveIn.WaveFormat.BitsPerSample);
Console.WriteLine(waveIn.WaveFormat.AverageBytesPerSecond);
Console.WriteLine(waveIn.WaveFormat.Channels);
Console.WriteLine(waveIn.WaveFormat.SampleRate);
Console.WriteLine(waveIn.WaveFormat.Encoding);
}
```

Which prints out...

```
32
1536000
2
192000
Extensible
```

If I check the e.Buffer data that the callback delivers, I see that most of the bytes have data indeed, but I was hoping to see 3 bytes with data and then an empty byte (24 bits and a spare byte), but all bytes have data.

So, how should I merge those bytes and in which order?

The Audio Board specs are:

Realtek Semiconductor Corp.
Audio driver 6.0.1.5919
DirectX 11.0
ALC889A

Thanks!
Comments: WASAPI loopback capture is capturing the audio format of the Windows mixing engine, which will be IEEE float 32 bit. The bit depth your soundcard is operating at has nothing to do with this - it could be 16 or 24 bit.

Viewing all articles
Browse latest Browse all 738

Trending Articles



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