Page 1 of 1

Text to speech

Posted: Fri Jul 11, 2008 9:14 pm
by Alan
I have been doing lots of HTA stuff recently......here's an ultra small text to speech wrapper for Microsoft SAM (Windows only). SAM isn't installed on Win 98 or 2000 by default (I think), but is in XP.

Save this as speech.HTA and double click it like an EXE. Then just type something in the text area and press the speak button. :-)

Code: Select all

<html><head><title>SAM Demo By Alan Bond</title><hta:application id="frmMain" singleInstance="yes" 
showInTaskbar="yes" contextmenu="no" maximizeButton="no" minimizeButton="no" border="thin"/></head>
<SCRIPT language="VBScript">
Dim tts:Set tts = Nothing:Set tts = CreateObject("Sapi.SpVoice"):Set tts.Voice = tts.GetVoices.Item(0)
Sub Window_OnLoad:self.reSizeTo 350,348:End Sub
Sub Speak():tts.Speak SpeakText.value, 1:End Sub	
</SCRIPT>
<BODY scroll="no" style="margin:0px"><INPUT type="button" value="Speak" onClick="Speak()"/>
<textarea id="SpeakText" cols="40" rows="18" >hello</textarea></BODY></HTML>

Posted: Fri Aug 08, 2008 11:27 am
by Sascha
Yes, it works...
Anyway, the voice is scary, his most realistic sentence is
"I sound like an ogre." :lol:

Posted: Sat Aug 09, 2008 8:17 am
by Davacardo
You definitely have my vote with Microsoft Sam being scary! Vista doesn't get Microsoft Sam though, we get Microsoft Anna...
Wikipedia used to have a "101 Things to do with Microsoft Sam", but I can't find it anymore.

I did the reverse today though. I got my computer to convert my speech to text! It's quite accurate actually.

Posted: Tue Aug 12, 2008 2:02 pm
by Alan
I did the reverse today though. I got my computer to convert my speech to text! It's quite accurate actually.
That's scarier.