Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int Read(float[] buffer, int offset, int count)
- {
- int samplesRead = source.Read(buffer, offset, count);
- // TODO: examine and optionally change the contents of buffer
- stereo2mono(ref buffer);
- return samplesRead;
- }
- private void stereo2mono(ref float[] buffer)
- {
- for (int i = 0; i < buffer.Count(); i = i + 2)
- {
- float temp = buffer[i] + buffer[i + 1];
- buffer[i] = temp / 2;
- buffer[i + 1] = temp / 2;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement