I need to get the sample values of sound data of a WAV file so that by using those sample values i need to get the amplitude values of that sound data in every second.
Important: Is there any way to get audio data sample values using Naudio library or wmp library?
I am getting the sample values in this way:
byte[] data = File.ReadAllBytes(File_textBox.Text);
var samples=new int[data.Length];
int x = 0;
for (int i = 44; i <data.Length; i += 2)
{
samples[x] = BitConverter.ToInt16(data, i);
x++;
}
But I am getting negative values more like (-326260). so is this right or wrong? I mean can a sample value be negative or not and if it is correct then what does it mean a sound or silence?