Reading Wave Files...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • subhakohila
    New Member
    • Apr 2008
    • 2

    Reading Wave Files...

    Hi,

    Can any one help me to read the wave file and pass through the modem to the telephone line....I tried with some set of codings but its returning some garbage values....

    The coding i used to read the file is..
    Code:
    public byte[]  ReadWavefile(string filename)
       {
    
           if (filename.Length > 0)
           {
               string fname = filename;
               if (File.Exists(fname))
               {
                   FileStream objwavestream = new FileStream(filename, FileMode.Open);
                   FileInfo f1 = new FileInfo(fname);
                   byte[] Wavdata = new byte[f1.Length];
                   BinaryReader bread = new BinaryReader(objwavestream);
                   
                   try
                   {
                       Wavdata = bread.ReadBytes(Convert.ToInt32(f1.Length));
                   }
                   catch (Exception e)
                   {
    
                   }
                   finally
                   {
                       bread.Close();
                   }
                   return Wavdata.ToString ();
               }
    
           }
           return null;
       }
    But this is returning me...0x52 and all the other values are "0"....Plea se give me a idea for reading the wav files and passing through the modem...

    Thank u....
    Last edited by Curtis Rutland; Jul 19 '08, 04:45 PM. Reason: Added code tags -- Please use the # button
  • BageDevimo
    New Member
    • Jul 2008
    • 10

    #2
    Read the binary, and send in packets of like, 1024 bytes or bigger through to the client/server.

    Comment

    Working...