I ran into a problem using WaveOut to play a WaveFormatConversionStream. It appears that WaveFormatConversionStream.Read is consistently reading only 4072 bytes into a 4800 byte buffer, but that discrepancy is not getting passed on to the WaveInterop.waveOutWrite call. I modified the WaveOutBuffer.OnDone method as follows
header.bufferLength = bytes; // fix
WriteToWaveOut();
Not sure of any negative side effects, but it seems to work so far.
Comments: if the wavestream given to the IWaveOut implementer is unable to provide the full number of bytes requested in Read, then effectively your latency is changed. I did it this way to ensure that badly behaving input streams don't cause hundreds of really small buffers to be sent to waveOutWrite. You could use BlockAlignReductionStream which has some built-in buffering.
header.bufferLength = bytes; // fix
WriteToWaveOut();
Not sure of any negative side effects, but it seems to work so far.
Comments: if the wavestream given to the IWaveOut implementer is unable to provide the full number of bytes requested in Read, then effectively your latency is changed. I did it this way to ensure that badly behaving input streams don't cause hundreds of really small buffers to be sent to waveOutWrite. You could use BlockAlignReductionStream which has some built-in buffering.