protected void openFileToolStripMenuItem_Click(object sender, EventArgs e) { if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { waveFile = new AudioUtils.WaveFile(openFileDialog1.FileName); waveFile.Read(); //isDraw = true; DrawGraph(); DrawEngeryGraph(); } }
private PointPairList ConvertToPointPairList(AudioUtils.WaveFile file) { if (file == null) { return(null); } PointPairList list = new PointPairList(); double height = zedGraphControl.Height / 4; for (int i = 0; i < file.WaveData.NumSamples; i++) { double val = file.WaveData[i]; double x = (double)((double)i / (double)(file.WaveFmt.SamplesPerSec) * 1000); double y = val; list.Add(x, y); } return(list); }