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

5.1 playback with Naudio?

Jan 26 at 6:00 PM
Hi guys,
is it possible to play 5.1 audio files with Naudio?
I'm getting an exception at
outputDevice.Init(mixer); 
step if trying to set channelCount = 6 creating WasapiOut or WaveOut instance.

System.ArgumentException was unhandled
HResult=-2147024809
Message=Value does not fall within the expected range.
Source=mscorlib
StackTrace:
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at NAudio.Wave.WasapiOut.Init(IWaveProvider waveProvider)
at NAudio.Wave.WaveExtensionMethods.Init(IWavePlayer wavePlayer, ISampleProvider sampleProvider, Boolean convertTo16Bit)....

Kind regards,
Andrei
Jan 26 at 7:50 PM
Some hardware and driver (Asio?) might support that, but not always. When you want to ensure playback, then mix the samples to 2 channels.
Jan 27 at 6:23 AM
But I need at least 4 channels to play.
Jan 27 at 7:51 PM
Then you could try with Asio and ship asio drivers with your assembly.
Jan 28 at 8:14 AM
OK. Thank you.
I will try with Asio drivers.
Jan 29 at 10:57 AM
It works now with AsioOut. Thank you Freefall !
I wonder are there any limitations of using Naudio AsioOut in a payware project related to Steinberg property right.
Can't see nothing about that in Naudio license.
Jan 31 at 7:01 AM
It was said NAudio is free to use, even for commercial applications