0

I want to make an application that reads the audio samples one by one manipulate them and than writing the new samples to a WAV file. However, when I tried to do this I only received white noise.

I tried to find whether the problem was with the manipulation or with the reading so I tried to simply extract data and rewrite to WAV (without changing the data) and I received a lot of white noise in addition to the original sound.

Can anyone tell me what I'm doing wrong?

FileStream fs = new FileStream(@path, FileMode.Open, FileAccess.Read);
byte[] arrfile = new byte[fs.Length - 44];
fs.Position = 44;
fs.Read(arrfile, 0, arrfile.Length);
fs.Close();

FileStream fo = new FileStream(@outfile, FileMode.Append, FileAccess.Write);
BinaryWriter bw = new BinaryWriter(fo);
bw.Write(arrfile);
bw.Close();
fo.Close();
Blorgbeard
  • 101,031
  • 48
  • 228
  • 272
efrat
  • 1
  • 2
  • 1
    Do you get the entire sound byte? The quality of the sound is in the byte[], so maybe a 24bit sound recording is being transmitted from a 16bit sender? Your code has nothing to do with the issue. – JWP Jun 08 '16 at 21:59
  • that's probably the problem because the file is 2822 kbps which means it's 32bit ,how can i fix it? – efrat Jun 09 '16 at 09:54
  • Ya it sounds like you are using a 28K baud modem with converts to 16 bit automatically. Don't use that modem or "dial up link" use the internet instead. – JWP Jun 09 '16 at 19:09

0 Answers0