473,396 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 1422
Read the binary, and send in packets of like, 1024 bytes or bigger through to the client/server.
Jul 19 '08 #2

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

Similar topics

1
by: Jakub Dudek | last post by:
Hi, I am trying to read wave date (the 16 bits audio words) from a wave file using c++. I have tried using the mmsystems library. I got to the point where I read the wave data chunk into a...
4
by: vikram | last post by:
in a stereo type of wave file i want to know what is this left & right info in a wave file??? how do i read the left & right info from a .wav file to a buffer..
1
by: Nadie | last post by:
Greeting list readers, I noticed that the wave read object has an *implementation dependent* setpos(pos) method. When reading audio files, it is useful to be able to set the position to a...
4
by: Erpman | last post by:
I am trying to access the data with in a wav file. I am testing with very small files in order to keep the code simple to start with. Basically, im writing the entire wav file to a byte using a...
5
by: m.topczewski | last post by:
Hello, I'm a beginner in c++, i have to write a program that will take couple of segments from one wave file, and store them in another wave file to be played back later. Here's the code i have...
1
by: blitzme | last post by:
I created a PERL script to play a wave file using Win32::Sound All went well. So then I was trying to create an executable file with the wav files bound inside it using Activestate Dev kit...
3
by: rajasekar.karthik | last post by:
Hi Guys I need a php script which will merge two wave files as i have already done a script which will will join the two wave files and play one after the other, can anyone advice me...
6
by: homevista | last post by:
PART III: Putting things together In part I we examined the modem to verify that it supported voice. If so, we took a note about the voice data format that we would use. In the second part, we...
0
by: SUHASNLG | last post by:
hi is there any body using wave files my problem is i have to take wave file from one location and i have to calculate it's length like duration in MM:SS is any body having the code please tell...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.