Premise New Text-To-Speech driver.

Motorola Premise

123

Senior Member
What is this?
SYSTester is the beta version of a new Text-To-Speech driver for Premise. It is designed to replace the existing MS-SAPI Speech driver which does not work with Windows Vista.

What else can it do?
It allows Premise to speak via a local or remote PC.

Is it a Windows Service?
No. To simplify the installation process, the beta version is a Windows Form application. The final release will be a Windows Service.

What do I need to test it?
  • One or more PCs running Windows XP or Vista.
  • Premise Server installed on at least one PC.
  • DebugView to observe SYSTester's operation.
How does it work?
  • Upon startup, SYSTester reads a configuration file containing the Premise Server's Name and Administrative account.
  • Click the Start button to connect to the Premise Server. Upon connection, it installs a new class on the Premise Server, called TTS, and creates a TTS device in Devices > CustomDevices (i.e. see "TTS_DEV004" in the attached image).
  • Click the Test Connection button and it will report the connection's status (i.e. it will say either OK or Not OK).
  • Click the Stop button to terminate the connection to the Premise Server.
Will I know if the connection to a remote PC is lost?
Yes. If the connection is lost, the TTS device's CommunicationFailure property will be set. It can optionally generate a Premise Event.

Installation Instructions
1. Choose a target PC.
  • The target PC can be any networked PC running Windows XP or Vista.
  • Ensure the target PC is equipped with .NET Framework 3.5.
  • If the target PC is a Premise Server, ensure the MS-SAPI Speech driver is not installed.
2. Install the software.
  1. Create a new folder on the target PC.
  2. Copy the attached zip archive to the new folder.
  3. Extract the contents.
3. Check Minibroker.
If the target PC is not equipped with Premise Server, nor Premise Builder, it probably lacks Minibroker and you must install it.
Copy c:\Program Files\Premise\SYS\bin\Minibroker.dll from your Premise Server to the target PC's c:\Windows folder (can be any folder).
Start the Command Prompt, change directory to c:\Windows, and run the following command:
regsvr32 minibroker.dll

4. Customize the configuration file.
You must modify the configuration settings to reflect your operating environment.
Using a text editor (Notepad), open SYSTester.exe.config and provide the following three parameters:
  1. The host name of your Premise Server (do not use "localhost")
  2. Username (administrative-level account)
  3. Password
To determine the target PC's host name:
  1. Open Control Panel and double-click System.
  2. Click the Computer Name tab.
  3. Use the information found in Full Computer Name.
5. Configure Windows Firewall.
FIRST STEP:
Add port 3976 as an Exception to Windows Firewall for UDP traffic.
  • Click Start > Run. Type firewall.cpl and press Enter.
  • Click the Exceptions tab.
  • Click Add Port.
  • For Name, enter: SSDP-UDP-3976
  • For Port Number, enter: 3976
  • Click UDP.
  • Click OK.
  • Click OK to exit Windows Firewall.

SECOND STEP
You have two options:
1. Run SYSTester and click "Unblock" when presented with the Windows Security Alert popup.
or
2. Add SYSTester as an Exception to Windows Firewall.
  • Click Start > Run. Type firewall.cpl and press Enter.
  • Click the Exceptions tab.
  • Click Add Program.
  • Click Browse.
  • Select SYSTester.exe.
  • Click OK.
  • Click OK to exit Windows Firewall.

Testing
SYSTester displays its operating progress in the Windows Debug Console. Use DebugView to view the messages posted in the Debug Console. If SYSTester does not appear to work properly, start DebugView and then start SYSTester. Click SYSTester's Start button and observe what is displayed in DebugView. Please post DebugView's log here (as an attachment) so I can review the messages and determine the cause of the problem.

You can test the TTS device via its user-interface (see the attached image) or by using a Script Macro. Here's a simple example:
Code:
' Content: a text string or a file path.
' ContentType: Text, TextFile, XML, XMLFile.
' Voice: one of the listed voices.
' Speak: speak the supplied Content.

with Devices.CustomDevices.TTS_DEV004
	.Content = "<volume level='75'/><emph>Hello world!</emph> I can speak on any PC."
	.ContentType = "XML"
	.Volume = 0.75
	.Voice = .Microsoft_Sam
	.Speak = true
end with

The following page describes Additional XML tags for controlling the Speech engine.
http://msdn.microsoft.com/en-us/library/ms717077(VS.85).aspx
http://www.tapiex.com/ES_Help/WP_XML_TTS_Tutorial.htm

Notes
I've confirmed SYSTester works on Windows XP and Vista 32-bit versions. I've not had success with Vista 64-bit.

BETA2
  • Supports versioning.
  • Better error-handling (i.e. if the RemoteSpeech object is flagged as Disabled or Read-Only).
  • If you delete a RemoteSpeech object, its associated Watchdog timer will remove itself quietly after it timesout.
BETA3
  • Now called TTS instead of RemoteSpeechClient.
  • Control Volume Level (without having to use an XML tag).
  • Set the Audio Format (default is 22kHz 16-bit mono).
  • Direct the generated speech to a WAV file (instead of an audio card).
 

Attachments

  • SYSTester_BETA3.zip
    77.8 KB · Views: 25
  • Beta3.png
    Beta3.png
    21.5 KB · Views: 20
Wow. 123 this is really neat. I've been moving the past few days, but I'll give this a try when comcast comes and hooks up my internet. I'm using my cell phone now for internet :(
 
Thanks.

Expect problems if you try it on Vista 64-bit. I've tried it on two separate PCs, equipped with Vista Home Premium 64-bit, and there's no joy.

My PC provides the best result and everything works properly until I turn on Windows Firewall. SYSTester loses its connection to the Premise Server despite the fact that I have made Firewall Exceptions for ports 3976 and 3977 and this arrangement works properly on Windows XP and Vista 32-bit.

My friend's PC provides the worst result. His PC is equipped with ZoneAlarm and SYSTester fails to connect to the Premise Server even when ZoneAlarm is turned off.

More testing is needed to determine what is so darn different about Vista 64.

FYI, for those playing along at home:

PS A big thank you to JimSpr for pointing out the ATL issue with DEP.
 
I use Vista 32 bit, but I'll try it regardless as I'd love to get something like MS-SAPI working under SYS on a Vista PC :(

Still no internet at the new place. It's amazing how much I rely on Premise now. I couldn't do without it after a day or two and ended up setting up my home network last night without internet just to use SYS locally. Those X10 palm pads are handy after all!
 
Thank you :D I promse to finally give it a try if the cable guy comes today to give me internet. Using a cell phone to type this is laborious!
 
I'm working on installing this now. Step 1 says: "If the target PC is a Premise Server, ensure the MS-SAPI Speech driver is not installed." For Vista, is it alright to disable the associated service instead of uninstalling MS-SAPI. It is unclear how to uninstall MS-SAPI as it doesn't show up under "Turn Windows Features On or Off." I could find the associated dll and delete it, but I thought I'd ask before I did this...

Under Control Panel\Speech Recognition Options I have stopped speach recognition is this sufficient?

Thanks
 
.. It is unclear how to uninstall MS-SAPI as it doesn't show up under "Turn Windows Features On or Off." I could find the associated dll and delete it, but I thought I'd ask before I did this...

Under Control Panel\Speech Recognition Options I have stopped speach recognition is this sufficient?..

Stop! Do not disable/uninstall/delete anything having to do with Windows' speech recognition or synthesis!


"MS-SAPI Speech driver" refers to the Premise speech driver developed by Rob Brun. In Premise Builder, check Devices and see if you have Rob's MSSAPI driver installed. Don't remove or disable anything in Windows Control Panel or Windows Services!
 
Thanks, good thing I waited :D It works great, thanks 123. Have a happy holiday.

UPDATE: One small issue discovered so far: windows allows hostnames to contain a "-", but for some reason, the Builders IDE doesn't like having a "-" in a devices name when you are scripting.

PS: I'm using Vista 32 bit with SP1 and .NET 3.5 SP1. No firewall set up locally on the PC, just on the router.
 
..UPDATE: One small issue discovered so far: windows allows hostnames to contain a "-", but for some reason, the Builders IDE doesn't like having a "-" in a devices name when you are scripting....
Yes, that's all part of VBScript's variable naming rules. Hyphens are legal characters in hostnames but will cause grief for Builder's scripting engine.

I have a function in SYSTester, called LegalVBName, that ensures a supplied string conforms to VBScript's variable naming rules. It is used to convert the names of voices and audio-outputs. For example, it converts "Microsoft Anna - English (United States)" to "Microsoft_Anna_English_United States". However, I don't use it to convert hostnames. Your best bet is to remove the hyphen from the PC's hostname.

Code:
		/// <summary>
		/// Return a string that conforms to the naming convention for VBScript variables.
		/// </summary>
		/// <param name="Name"></param>
		/// <returns></returns>
		private string LegalVBName(string Name)
		{
			Regex re1 = new Regex("[^a-z0-9_]", RegexOptions.IgnoreCase); // All non-alphanumeric characters except underscores
			Regex re2 = new Regex("^[0-9].");	   // Leading numbers
			Regex re3 = new Regex("__*");		   // Two or more underscores
			Regex re4 = new Regex("^_*");		   // Leading underscores
			Regex re5 = new Regex("_*$");		   // Trailing underscores

			string result = re1.Replace(Name, "_"); // Replace non-alphanumeric characters with underscores
			result = re2.Replace(result, "");	   // Remove leading numbers
			result = re3.Replace(result, "_");	  // Replace two or more underscores with a single underscore
			result = re4.Replace(result, "");	   // Remove leading underscores
			result = re5.Replace(result, "");	   // Remove trailing underscores
			return result;
		}
Kind of a brute-force technique ... there's probably a way of performing the conversion with fewer Regex statements but I haven't had time to optimize the code.
 
The first post now contains the BETA3 version.

If you were testing a previous version, delete it and its associated Module (Modules > RemoteSpeechClient).

I believe this latest version contains all the features needed for Text-To-Speech support. BETA3 adds:
  1. Ability to adjust the spoken volume (without having to use an XML tag)
  2. Set the audio format
  3. Direct the generated speech to a file as opposed to an audio card

This is in addition to:
  • Phrase to be spoken can be a text string, XML string, or a file containing text or XML.
  • Select the voice (from a list of available voices; list can be refreshed).
  • Select the audio output (from a list of available audio cards; list can be refreshed).
  • Speak asynchronously (i.e. non-blocking; spoken phrases are in a queue).
  • Stop speaking (i.e. purge the speech queue).
  • Report driver status.
  • Log an event if the driver loses connection with Premise Server.
 
As a side note, I would think it'd be possible to type in a text box and have a message read aloud through the speakers of any PC opened to the automation page using the driver you've made. Kind of like a text to speech intercom.

Along these same lines, I always thought it'd be really neat if one could use any pc with a microphone (and the automation browser page open) as an intercom to talk to out of the speakers for all other computers navigated to the automation browser page. Perhaps this would be a push to talk interface. Has anyone made such a driver and I just didn't see it?
 
For the folks following my progress on this item:
The new Text-To-Speech driver, Premise TTS, now has an installer program and runs as a Windows Service. One very frustrating programming glitch has forced me to eliminate the "Stop" property ... no big loss.

I've been unable to eliminate the odd behaviour first seen in Rob Brun's MS-SAPI driver. While the driver is operational, you cannot run a simple text-to-speech script like:

set oVoice = CreateObject("SAPI.SpVoice")
oVoice.Speak "Hello!"

Windows Script Host generates an "Access Denied" error message. Bizarre. I'm not happy about that but I've not been able to find a workaround.
 
Back
Top