Frage

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?

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top