Click here to Skip to main content
13,260,018 members (48,707 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
I am trying to recreate a wav file after manipulating its sample values which i have stored in an array (of short). I get no error in my code but the audio quality is not good. The output sounds similar to the original voice but is a very hoarse sound. Can anybody suggest me what could be the possible reason for this hoarseness?
Posted 26-Aug-12 4:16am
Updated 26-Aug-12 4:17am
v2
Comments
Kenneth Haugland 26-Aug-12 9:19am
   
Is the sound cutoff (meaning the values in the file get peaks and bottoms at the maximum and minimum storage), how is the recording, did you filter it etc...
Zoltán Zörgő 26-Aug-12 9:24am
   
Look at the waveform with an editor, like Audacity. If you used short's, that means you assumed that the original file had 8 bit sampling. Was this assumption correct?
sai krishna 6-Mar-13 4:27am
   
Hello,
I have two .wav files.How can I subtract one sound from the other.
Please do reply.......
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Don't forget, that a WAVE file is a simple RIFF container and you'll need to know the exact codec which was used to encode the WAV-file. Assuming you chose a RIFF WAVE with simple PCM codec, which you should identify using the file header of your WAVE file, you have to know the sample rate, the channels used and as already mentioned the resolution of your WAVE. All this information could be got from the WAVE file header. I assume that you're having a 16Bit WAVE file and read shorts (8-Bits) so you're doing your modifications or whatever to the low and high bytes which is probably in most cases a very bad idea. There is a lot of information regarding the WAVE file format. Use google to find it.

Possibly this could be a good start.
  Permalink  
Comments
sai krishna 6-Mar-13 4:27am
   
Hello,
I have two .wav files.How can I subtract one sound from the other.
Please do reply.......
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

You can use ready-made libraries. Start here: C# WAV file class, audio mixing, and some light audio manipulation[^], but NAudio[^] or BASS API[^] are also a good starting points.
  Permalink  
Comments
sai krishna 6-Mar-13 4:27am
   
Hello,
I have two .wav files.How can I subtract one sound from the other.
Please do reply.......
Zoltán Zörgő 6-Mar-13 8:18am
   
First define the waveform subtraction in mathematical terms.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web02 | 2.8.171114.1 | Last Updated 27 Aug 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100