Premise [download] Module: TextToSpeech

Motorola Premise

123

Senior Member
index.php
File Name: Module: TextToSpeech
File Submitter: 123
File Submitted: 03 Dec 2009
File Updated: 07 Feb 2012
File Category: Premise
Author: 123
Contact: PM me
Version: 1.3

New in version 1.3:
  • Works with Windows Vista and Windows 7
    V1.3 overcomes the constraint imposed on Windows’ SAPI engine in Windows Vista and Windows 7.
  • Automatic Pause and Resume
    If the Audio Card is currently playing music, the TextToSpeech driver will pause the music, wait two seconds (‘dead-air’; to gain the listener’s attention), speak the phrase, and then resume the music. If there is no music in progress, the phrase is spoken immediately (i.e. no ‘dead-air’).
  • AudioQueue
    All phrases are buffered in a queue (“AudioQueue”) and delivered to the Audio Card in sequence. You can create several spoken phrases, in rapid succession, and they will wait their turn to be played by the Audio Card.
  • AudioClip
    You can have an audio file played prior to the spoken phrase. This is a useful feature for announcements; a chime sound can be played, to gain one’s attention, prior to speaking the announcement.
  • Google Translate
    You can choose to have a phrase spoken using Google Translate's voice instead of Windows’s SAPI engine. The phrase can be written in English or in other languages. You can also have the phrase automatically translated from one language to another and then spoken. For example, the phrase can be written in English, translated into Spanish, and then spoken in Spanish.
  • Documentation
    The driver is fully documented and includes several scripting examples.

Click here to download this file
 
123 - nice job on this! I've been playing around with it this weekend...works well, I haven't encountered any problems so far...I'm thrilled you've taken this a step further. Much easier to use, very flexible, and 'idiot proof' (which means I got it to work!)

I'm 'working' with some avatar software (www.alteregos.com)...just checking it out, particularly as it seems like a vast improvement over the early avatar efforts (which is a different thread)

How cool will it be to have an avatar, telling me 'the fountain has turned off', hanging in front of Damon's Coffeeshop UI?
 
123 - the default voices work fine - I was looking at some other voices from www.cepstral.com ; downloaded one, installed it. TTS module picks the voice up after rescanning. However, it throws an error when 'speaking' (specifially, it dies at the TTS method at

Code:
if this.ContentType = 0 or this.ContentType = 8 then  
  oSpeech.Speak this.Content, this.ContentType

Any ideas?
 
At long last, Text-To-Speech now works in Premise on post-XP versions of Windows!

I've also added new functionality that works equally well in XP:

AudioQueue
You don't have to wait for one message to finish speaking before submitting another one. Consecutive messages are stored in a queue and submitted to the Audio Card in the sequence they arrive (FIFO).

Automatic Pause and Resume
If the Audio Card is playing music, the TextToSpeech driver will pause it, wait a moment, play speech, then resume the music. If there are multiple speech files in the AudioQueue, the driver won't resume the music immediately because that could cause an audible snippet of the music between consecutive speech files. It resumes music only after the AudioQueue is empty.

AudioClip
Now you can specify an AudioClip to be played prior to the speech. This is handy for playing a chime tone, to gain the listener's attention, just before an announcement. The AudioClip can be any audio file in Media > Contents.

Google Translate
If you don't care for Microsoft Anna 's voice you can have a phrase spoken by Google Translate's voice (also female). The first bonus is that you can enter a phrase in French, Italian, Spanish, etc and have it spoken in that language. The second bonus is you can enter it in English and then choose to have it translated, and spoken, in another language.

NOTE: Converting an English phrase into English speech and playing the resulting MP3 file is very easy with Google Translate. However, translating from one language to another is not a free service from Google (Google Translation API V2). There is a way to do it without the API and that's by 'screen-scraping' a web-page. This is a fragile technique that relies on the web-page's format remaining stable. If Google alters some CSS and a few DIVs here and there, it is likely that my TextToSpeech driver will fail to acquire the translated result (but will fail gracefully, I hope).

Documentation
The driver is now fully documented and contains six scripting examples.
 
Does anyone know where I can get the ComputerAudio driver? I cannot find it anywhere (on my computer or in the forums).
 
As far as I know, it's built in.  As long as you have standard audio devices in Windows, Premise should see it.
 
For future reference, you don't need to reboot when adding something into Premise.  At most, just restart the Premise service.
 
Back
Top