Search code examples
c#.netvisual-studio-2010text-to-speech

Microsoft Speech in windows service


In my windows service .NET 4.0 application I use SpeechSynthesizer to speech some text. In Windows XP works great, but on Windows 7 it doesn't play anything. Why?

(Microsoft Server Speech Platform Runtime 11.0 + Speech Text To Speech Voice Lucia)

many thanks, Riccardo


Solution

  • Please try using System.Speech and System.Speech.Synthesize instead of Microsoft.Speech. I have developed a tool to recoganize the voice using System.Speech which is working good for me in Windows Vista, Windows 7. Please do a check whether your windows speech system is working or not.

    http://visualstudiogallery.msdn.microsoft.com/f2964c90-68e2-4ddd-861a-bd66e5cd4434

    To use "it-IT" culture

    Private Sub CreateSpeechRecoginationEngine(culture As String)
        Dim _culture As CultureInfo
        For Each recognizer In SpeechRecognitionEngine.InstalledRecognizers
            If recognizer.Culture.Name.Equals(culture) Then
                _culture = recognizer.Culture
                Exit For
            End If
        Next
        If _culture Is Nothing Then _culture = SpeechRecognitionEngine.InstalledRecognizers()(0).Culture
        SpeechRecognitionEngine speechRecoginationEngine = New SpeechRecognitionEngine(_culture)
    End Sub