Which way is best for sampling both left and right channels?

Apr 16, 2013 at 2:57 AM
Quick question...
Which way is best for sampling both left and right channels?
        private ISampleProvider CreateInputStream(string fileName)
        {
            fileStream = OpenWavStream(fileName);
            var inputStream = new SampleChannel(fileStream, true);
            var sampleStream = new NotifyingSampleProvider(inputStream);
/// this way?
            sampleStream.Sample += (s, e) => aggregator.Add(e.Left);
            sampleStream.Sample += (s, e) => aggregator.Add(e.Right);
OR
/// this way?
            sampleStream.Sample += (s, e) => aggregator.Add(e.Left + e.Right);

            return sampleStream;
        }
Thank you!
Dan
Coordinator
Apr 16, 2013 at 4:12 PM
the first way if you were drawing separate waveforms for left and right
Apr 17, 2013 at 2:44 AM
Edited Apr 17, 2013 at 2:44 AM
markheath wrote:
the first way if you were drawing separate waveforms for left and right
Thank you. Would the second way be appropriate for "mixing" the two channels if I was drawing one waveform?
Coordinator
Apr 18, 2013 at 4:09 PM
yes, although quite often if I am drawing one waveform for a stereo signal I just cheat and draw one of the two channels.