Пример #1
0
        private void editorPlayButton_Click(object sender, EventArgs e)
        {
            saveSoundToolStripMenuItem.Enabled = true;
            editorFormantSpecification.FundamentalFrequency = speechSynthesizer.FundamentalFrequency;
            editorFormantSpecification.SamplingFrequency    = speechSynthesizer.SamplingFrequency;
            editorFormantSpecification.GenerateSettingsSequence();
            speechSynthesizer.StorePitch = true;
            WAVSound sound = speechSynthesizer.GenerateSound(editorFormantSpecification);
            //  List<double> pitchList = speechSynthesizer.PitchList;
            //  augmentedSoundVisualizer.SetSound(sound, pitchList);

            int selectedIndex = formantSpecificationListBox.SelectedIndex;

            editorSpeechVisualizer.SetSound(sound);
            List <List <double> > timePitchPeriodList = speechSynthesizer.TimePitchPeriodList;

            editorSpeechVisualizer.SetTimePitchPeriodList(timePitchPeriodList);
            ShowFormantSpecification(selectedIndex);
            SoundPlayer soundPlayer = new SoundPlayer();

            sound.GenerateMemoryStream();
            sound.WAVMemoryStream.Position = 0; // Manually rewind stream
            soundPlayer.Stream             = null;
            soundPlayer.Stream             = sound.WAVMemoryStream;
            soundPlayer.PlaySync();
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
                }
            }
        }