private void assignCurrentSoundButton_Click(object sender, EventArgs e) { editorFormantSpecification = formantSpecificationMatrix[1][1].Copy(); ShowFormantSpecification(0); editorFormantSpecification.GenerateSettingsSequence(); FormantSpeechSynthesizer speechSynthesizer = new FormantSpeechSynthesizer(); WAVSound sound = speechSynthesizer.GenerateSound(editorFormantSpecification); editorSpeechVisualizer.SetSound(sound); // soundNameTextBox.Text = ""; // soundEditorVisualizer.ClearHistory(); // soundEditorVisualizer.SetSound(sound); }
private void EvaluateAll() { FormantSpeechSynthesizer speechSynthesizer = new FormantSpeechSynthesizer(); for (int iX = 0; iX < formantSpecificationMatrix.Count; iX++) { for (int iY = 0; iY < formantSpecificationMatrix[0].Count; iY++) { FormantSpecification formantSpecification = formantSpecificationMatrix[iX][iY].Copy(); formantSpecification.GenerateSettingsSequence(); WAVSound sound = speechSynthesizer.GenerateSound(formantSpecification); soundVisualizer3x3.SetSound(sound, iX, iY); } } }
private void loadSpeechSynthesizerToolStripMenuItem_Click(object sender, EventArgs e) { using (OpenFileDialog openFileDialog = new OpenFileDialog()) { openFileDialog.Filter = "XML files (*.xml)|*xml"; if (openFileDialog.ShowDialog() == DialogResult.OK) { speechSynthesizer = (FormantSpeechSynthesizer)ObjectXmlSerializer.ObtainSerializedObject(openFileDialog.FileName, typeof(FormantSpeechSynthesizer)); foreach (FormantSpecification fs in speechSynthesizer.SpecificationList) { fs.FormantSettingsList.Last().TransitionStart = 1; } ShowSpeechSynthesizer(); saveSpeechSynthesizerToolStripMenuItem.Enabled = true; speakSentenceButton.Enabled = true; } } }
private void GenerateNewSpeechSynthesizer() { speechSynthesizer = new FormantSpeechSynthesizer(); speechSynthesizer.StorePitch = true; FormantSpecification longSilenceSpecification = new FormantSpecification(speechSynthesizer.FundamentalFrequency, speechSynthesizer.SamplingFrequency); longSilenceSpecification.Name = "="; FormantSettings longSilenceSettings = new FormantSettings(); longSilenceSettings.SetSilence(LONG_SILENCE_SOUND_DURATION); longSilenceSpecification.FormantSettingsList.Add(longSilenceSettings); speechSynthesizer.SpecificationList.Add(longSilenceSpecification); FormantSpecification shortSilenceSpecification = new FormantSpecification(speechSynthesizer.FundamentalFrequency, speechSynthesizer.SamplingFrequency); shortSilenceSpecification.Name = "-"; FormantSettings shortSilenceSettings = new FormantSettings(); shortSilenceSettings.SetSilence(SHORT_SILENCE_SOUND_DURATION); shortSilenceSpecification.FormantSettingsList.Add(shortSilenceSettings); speechSynthesizer.SpecificationList.Add(shortSilenceSpecification); }