/** * Placeholder for creating a new wave */ private void MenuItem_New(object sender, RoutedEventArgs e) { float[] soundData = new float[10000]; Random random = new Random(); for (int i = 0; i < 10000; i++) { soundData[i] = random.Next(-10, 11); } waveGraph = new WaveGraph(WaveCanvas, WaveBorder, soundData, 1000); freqGraph = new FrequencyGraph(FrequencyCanvas, soundData); }
private void MenuItem_StopRecord(object sender, RoutedEventArgs e) { recorder.StopRecord(); float[] recordedSamples = recorder.getRecordingData(); waveGraph = new WaveGraph(WaveCanvas, WaveBorder, recordedSamples, 44100); freqGraph = new FrequencyGraph(FrequencyCanvas, recordedSamples); //change button/menu switches record_MI.IsEnabled = true; record_BTN.IsEnabled = true; play_BTN.IsEnabled = true; stop_MI.IsEnabled = false; stop_BTN.IsEnabled = false; }