I try to play a 32 bit byte array via naudio and ASIO. But i can not get it running. The output signal is distorted. The same converting method works fine with 32 bit for naudio and WASAPI.
Sample convert:
var newAmp = (int)Math.Round(amp * (Math.Pow(2, 32) / 2));
var buffer = BitConverter.GetBytes(newAmp);
The Play and record via naudio and ASIO:
var waveToneClass = new WaveTone(48000, 32, playBuffer, true, 1);
var stream = new BlockAlignReductionStream(waveToneClass);
asio_outin = new AsioOut(nameOfDriver);
asio_outin.ChannelOffset = 0;
asio_outin.InputChannelOffset = 0;
asio_outin.InitRecordAndPlayback(stream, 1, 48000);
asio_outin.AudioAvailable += ASIO_dataAvailable;
asio_outin.Play();
with:
private AsioOut asio_outin = null;
With 16 bit and the same method i get a clean Signal. But for very low output levels and a high gain i get artefacts and that´s the reason for 32bit.
NAudio v1.7.3.0 / Windows 7 / .Net 4.0
What is my failure?