If you have sound that's already IeeeFloat but you use ASIO, it seems to me it must be deinterleaved as I found of no way to just pass the interleaved floats through it.
So I've added these to NAudio\Wave\Asio\ASIOSampleConvertor.cs:
case ASIOSampleType.ASIOSTFloat32LSB:
switch (waveFormat.BitsPerSample)
{
case 32:
convertor = (SampleConvertor)ConvertorFloatToFloat2Channels;
break;
}
break;
// IeeeFloat to ASIOSTFloat32LSB (deinterleave)
public static void ConvertorFloatToFloat2Channels(IntPtr inputInterleavedBuffer, IntPtr[] asioOutputBuffers, int nbChannels, int nbSamples)
{
unsafe
{
float* inputSamples = (float*)inputInterleavedBuffer;
float* leftSamples = (float*)asioOutputBuffers[0];
float* rightSamples = (float*)asioOutputBuffers[1];
for (int i = 0; i < nbSamples; i++)
{
*leftSamples++ = inputSamples[0];
*rightSamples++ = inputSamples[1];
inputSamples += 2;
}
}
}
So I've added these to NAudio\Wave\Asio\ASIOSampleConvertor.cs:
case ASIOSampleType.ASIOSTFloat32LSB:
switch (waveFormat.BitsPerSample)
{
case 32:
convertor = (SampleConvertor)ConvertorFloatToFloat2Channels;
break;
}
break;
// IeeeFloat to ASIOSTFloat32LSB (deinterleave)
public static void ConvertorFloatToFloat2Channels(IntPtr inputInterleavedBuffer, IntPtr[] asioOutputBuffers, int nbChannels, int nbSamples)
{
unsafe
{
float* inputSamples = (float*)inputInterleavedBuffer;
float* leftSamples = (float*)asioOutputBuffers[0];
float* rightSamples = (float*)asioOutputBuffers[1];
for (int i = 0; i < nbSamples; i++)
{
*leftSamples++ = inputSamples[0];
*rightSamples++ = inputSamples[1];
inputSamples += 2;
}
}
}