Example #1
0
        private void SingleWord(object sender, EventArgs e)
        {
            var word = wordBox.SelectedItem;

            if (word != null)
            {
                WAVSound sound = _synthesizer.GenerateWord((string)word);

                SoundPlayer soundPlayer = new SoundPlayer();
                sound.GenerateMemoryStream();
                sound.WAVMemoryStream.Position = 0; // Manually rewind stream
                soundPlayer.Stream             = null;
                soundPlayer.Stream             = sound.WAVMemoryStream;
                soundPlayer.PlaySync();
            }
        }