In a mix of trying to alter code fom this tutorial: https://www.youtube.com/watch?v=ZnFoVuOVrUQ
- and trying to get the peak values of a recorded wave I ended up with this:
while (wave.Position < wave.Length )
{
read = wave.Read(buffer, 0, 16384);
for (int i = 0; i < read / 4; i++)
{
if (i < 5000){
chart1.Series["wave"].Points.Add(BitConverter.ToSingle(buffer, i * 4));
liste.Add(chart1.Series["wave"].Points[Convert.ToInt32(wave.Position/4096)].YValues[0]);
}
if (wave.Position % 16384 == 0 && i % 4096 == 0)
{
Console.WriteLine("Values!!: "+ liste[i]);
Console.WriteLine("values: " + chart1.Series["wave"].Points[Convert.ToInt32(BitConverter.ToDouble(buffer,
i / 4))].YValues[0]);
}
}
textBox1.Text = Convert.ToString(optaelPeaks);
textBox2.Text = Convert.ToString(wp);
}
- but the output of this code doesn't really makes sense in the console as all the values lays between 0.027 and 0.089 (in a very looping-like pattern, that doesn't resembles the .wav I am analyzing/loading), as opposed to the chart1 that shows values from -1.0 to 1.0.
I have also been checking up on Voicerecorder and this link: http://stackoverflow.com/questions/14350790/naudio-peak-volume-meter
- without getting further (as a Dane I have trouble with more in depth math English terms like: "take the log base 10 of the maximum value") ... Hope you can help me /on before hand thx /Thomas