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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top