I converted a WaveProvider16 to a SampleProvider using Pcm16BitToSampleProvider. I then added it to a MixingSampleProvider. The logs did indicate that both are IeeeFloat. But the program halted at the AddMixerInput line and the error was All mixer inputs must have the same WaveFormat.
Any thought of what I have missed?
myWaveProvider = new MyWaveProvider16();
mySampleProvider = new Pcm16BitToSampleProvider(myWaveProvider);
mixerBusWaveFormat = WaveFormat.CreateIeeeFloatWaveFormat(8000, 1);
myMixer = new MixingSampleProvider(mixerBusWaveFormat);
myMixerSampleSource = new MixerSampleSource();
Debug.WriteLine("mySampleProvider waveformat: " + mySampleProvider.WaveFormat.ToString());
Debug.WriteLine("myMixer waveformat: " + myMixer.WaveFormat.ToString());
myMixer.AddMixerInput(mySampleProvider);
Output:
mySampleProvider waveformat: IeeeFloat
myMixer waveformat: IeeeFloat
A first chance exception of type 'System.ArgumentException' occurred in NAudio.dll An unhandled exception of type 'System.ArgumentException' occurred in NAudio.dll
Additional information: All mixer inputs must have the same WaveFormat