Testing Speech Grammars

Sunday, December 19, 2010
In an earlier post I wrote about speech grammars in Lync Server and Exchange Unified Messaging.

Here's a simple VBScript that uses the same speech method to hear how speech-enabled programs pronounce words.  This is useful to determine how these programs will pronounce proper names.
sText = InputBox("Enter the text you want the computer to say.", "Text to Speech")
sText = Trim(sText)

If sText <> "" Then
     set sapi = CreateObject("sapi.spvoice")
     sapi.Speak sText
End If
To accomplish the same thing in PowerShell, use the following:
$Voice = New-Object -com SAPI.SpVoice
$Voice.Speak( "Keith Johnson" )
For example, if you enter my name as it's spelled (Jeff Guillet) you will hear how speech enabled applications mispronounce my name.  In the case of Exchange UM directory lookups, this is also how Exchange expects callers to pronounce my name to find a match.  If you enter the phonetic spelling of my name (Jeff GheeA) you will hear it pronounced correctly. 

By testing different phonetic spellings using these scripts, you can determine what to use for the msDS-PhoneticDisplayName attribute in Active Directory.

1 comment:

  1. I tried this on a Windows 7 workstation and the pronunciation is different from that produced by my Exchange 2010 UM server (the server pronunciation is much better)

    When I try the same powershell command on the UM server it throws an exception. Do you know of any way to test pronunciation using the Exchange UM speech engine?


Thank you for your comment! It is my hope that you find the information here useful. Let others know if this post helped you out, or if you have a comment or further information.