Rahul Choudhary

Rahul Choudhary

  • NA
  • 5
  • 7.6k

My Code

Dec 27 2013 8:53 AM
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            string _FileName = "C:\\Enya.mp3";
            byte[] p;
            p=File.ReadAllBytes(_FileName);
            byte[] Stm = StereoToMono(p);
            
        
        }
        public byte[] StereoToMono(byte[] input)
        {
            byte[] output = new byte[input.Length / 2];
            int outputIndex = 0;
            for (int n = 0; n < input.Length; n += 4)
            {
                // copy in the first 16 bit sample
                output[outputIndex++] = input[n];
                output[outputIndex++] = input[n + 1];
            }
            return output;
        }
        
        

    }
}







I now wish this program to run but it shows an error in this line " byte[] Stm = StereoToMono(p);"

Answers (4)