Partilhar via


Updating speech samples for beta 2

When beta 1 shipped, we published this article in MSDN Magazine.

We've made some minor tweaks to the API for beta 2, and I figure what better way to illustrate them than to walk through the samples in that article and update them for beta 2.

First, the install. I installed two pieces of software:

  1. Vista beta 2.
  2. Visual C# Express Edition

I didn't need to install WinFX (it's part of Vista and installed by default in beta 2). I didn't need to install the SDK.

One of the most frequently asked questions in beta 1 was "how on Earth do I add a reference to System.Speech?". The answer then was to first install the SDK, then add a reference to "Speech", not "System.Speech". Ack! Sorry about that. It now works as it should. I just went into the "Add Reference" dialog in VC# and double clicked on System.Speech.

Today's updated sample is the first sythnesis sample from the article. The only real change is that we dropped "SpeakText()" and overloaded "Speak()" to take a string. Pretty simple.

using

System;
using System.Collections.Generic;
using System.Text;
using System.Speech.Synthesis;
namespace Synth_sample_1
{
   class Program
   {
      static void Main(string[] args)
{
         SpeechSynthesizer synth = new SpeechSynthesizer();
synth.SelectVoice("Microsoft Anna");
synth.Speak("Speak text has been replaced by an overload on speak.");
}
}
}

Well, that's all for today. More soon...

Comments

  • Anonymous
    July 08, 2006
    Hey Robert!

    Where is the second sample application update?

    Shredster
  • Anonymous
    July 08, 2006
    what about part 2?