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

Left and Right channel for SignalGenerator

Oct 8, 2013 at 2:54 PM
I am generating a Sine signal using the SignalGenerator class. Can someone please suggest how can I switch the output between the left only, right only and both speakers ?

How can I use the volumesampleprovider with SignalGenerator?

Thank you in advance for your help
Oct 8, 2013 at 7:51 PM
From my research I think I need to play the audio into a buffer, mute every alternate sample depending on whether we want to play it to left or right speaker, and then play the file from the buffer. But all of this has to be done on the fly. Can someone point me to a sample where this is being done?
Oct 8, 2013 at 8:27 PM
Much easier to create a StereoVolumeSampleProvider, with a LeftVolume and RightVolume property. In the Read method, read from the source (i.e. signal generator) and multiply every pair of samples by LeftVolume and RightVolume. Very simple and will give you exactly what you want.