private void stop(object sender, RoutedEventArgs e) { if (!isRecording || this.lvSentences.SelectedItems.Count < 1) { return; } isRecording = false; recorder.Close(); filewriter.Close(); int index = this.lvSentences.SelectedIndex; lblRecording.Visibility = System.Windows.Visibility.Hidden; Sentence sentence = (Sentence)this.lvSentences.SelectedItem; loadLanguage(); // Called to refresh the sentence data of the current langugae this.lvSentences.SelectedIndex = index; wavProcessor processor = new wavProcessor(); int noiceLevel = (int)this.noiceLevelSlider.Value; processor.StripSilence(sentence.fullPath, noiceLevel); processor.ToneIn(sentence.fullPath); processor.ToneOut(sentence.fullPath); processor.SpeedUp(sentence.fullPath, (int)this.speedSlider.Value); }