469,903 Members | 1,991 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,903 developers. It's quick & easy.

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..
Expand|Select|Wrap|Line Numbers
  1. public byte[]  ReadWavefile(string filename)
  2.    {
  3.  
  4.        if (filename.Length > 0)
  5.        {
  6.            string fname = filename;
  7.            if (File.Exists(fname))
  8.            {
  9.                FileStream objwavestream = new FileStream(filename, FileMode.Open);
  10.                FileInfo f1 = new FileInfo(fname);
  11.                byte[] Wavdata = new byte[f1.Length];
  12.                BinaryReader bread = new BinaryReader(objwavestream);
  13.  
  14.                try
  15.                {
  16.                    Wavdata = bread.ReadBytes(Convert.ToInt32(f1.Length));
  17.                }
  18.                catch (Exception e)
  19.                {
  20.  
  21.                }
  22.                finally
  23.                {
  24.                    bread.Close();
  25.                }
  26.                return Wavdata.ToString ();
  27.            }
  28.  
  29.        }
  30.        return null;
  31.    }
  32.  
But this is returning me...0x52 and all the other values are "0"....Please give me a idea for reading the wav files and passing through the modem...

Thank u....
Jul 19 '08 #1
1 1296
Read the binary, and send in packets of like, 1024 bytes or bigger through to the client/server.
Jul 19 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Jakub Dudek | last post: by
4 posts views Thread by vikram | last post: by
1 post views Thread by Nadie | last post: by
4 posts views Thread by Erpman | last post: by
5 posts views Thread by m.topczewski | last post: by
1 post views Thread by blitzme | last post: by
reply views Thread by SUHASNLG | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.