Example #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            recorder.StopRecording();
            int len = 0;
            byte[] b = recorder.getByteArray(ref len);

            Complex[][] data = dataHandler.GetFFTArray(b, len, 1);
            var hash = new Hash(data);

            var s = new spectrogram(spectrogramPicture.Width, spectrogramPicture.Height);
            s.drawSpectrogram(data);
            s.drawPeaks(hash.getPeakPairs());

            spectrogramPicture.Image = s.image;
        }
Example #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            DialogResult result = openFileDialog1.ShowDialog();
            if (result == DialogResult.OK)
            {
                textBox1.AppendText(openFileDialog1.FileName+"\n");
                int bLen = 0, channels = 0;
                byte[] b = mp3Processor.getByteArray(openFileDialog1.FileName, ref bLen, ref channels);
                Complex[][] comData = dataHandler.GetFFTArray(b, bLen, channels);
                var hash = new Hash(comData);

                var s = new spectrogram(spectrogramPicture.Width, spectrogramPicture.Height);
                s.drawSpectrogram(comData);
                s.drawPeaks(hash.getPeakPairs());

                spectrogramPicture.Image = s.image;
            }
        }