问题
I'm using NAudio for sound work. And i have specific task. I have 8 channel sound card. How can I play sound in only 1, 2 or more specific channels. For example I have this code:
Device = new WaveOut();
var provider = new SineWaveProvider32();
provider.SetWaveFormat(44100, 1);
provider.Frequency = 1000f;
provider.Amplitude = 1f;
Device.DeviceNumber = number;
Device.Init(provider);
Device.Play();
This code play sound on all channels. What i need to change in this?
回答1:
You could use a MultiplexingWaveProvider
and pass in a silence producing wave provider for one channel and a SineWaveProvider32 for the other.
Also note that your soundcard may not necessarily support multi-channel audio through the WaveOut API.
来源:https://stackoverflow.com/questions/22248138/play-sound-on-specific-channel-with-naudio