Alexander Mashin
Alexander Mashin

Reputation: 711

Play sound on specific channel with NAudio

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?

Upvotes: 1

Views: 1701

Answers (1)

Mark Heath
Mark Heath

Reputation: 49482

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.

Upvotes: 4

Related Questions