This project has moved and is read-only. For the latest updates, please go here.

Same format - Mixing WAV channels

Apr 30, 2015 at 9:59 PM
Hey guys,

I am mixing two WAV files, one has 32 BitsPerSample and the other one has 16 BitsPersSample. WaveMixerStream32 is giving me an error:
An unhandled exception of type 'System.ArgumentException' occurred in NAudio.dll
Additional information: All incoming channels must have the same format
I have one 32 WAV and one MP3 which I convert to WAV. The converted MP3to WAV has 16bps.

Can you help me how to ensure the same bps for both files?
May 1, 2015 at 12:08 PM
You can´t mix files with different wave Format directly.

Ensure the following:

1) Same Samplerate -> Resample with Mediafoundationresampler, WaveFormatConversionStream etc.
2) Same bit depth -> Use a Sampleprovider for your conversion, e.g. WaveToSampleProvider etc.
3) Same channel Count -> Use a Sampleprovider for your conversion, e.g. MonoToStereoSampleProvider etc.
4) Same Format tag (I think this is optional as it doesn´t affect the data directly)

Conclusion: Better work with sampleproviders for Mixing purpose. Hope this Points you in the right direction.