Text to speech

Discussion around programming R'n'D, its source code and its tools.

Moderators: Zomis, Flumminator

Post Reply
User avatar
Alan
Posts: 661
Joined: Fri Jun 18, 2004 7:48 pm

Text to speech

Post by Alan » Fri Jul 11, 2008 9:14 pm

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>

User avatar
Sascha
Posts: 348
Joined: Fri May 12, 2006 6:17 pm
Location: Germany
Contact:

Post by Sascha » Fri Aug 08, 2008 11:27 am

Yes, it works...
Anyway, the voice is scary, his most realistic sentence is
"I sound like an ogre." :lol:
Image

User avatar
Davacardo
Posts: 89
Joined: Sun Jul 22, 2007 10:36 am
Location: Australia

Post by Davacardo » Sat Aug 09, 2008 8:17 am

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.

User avatar
Alan
Posts: 661
Joined: Fri Jun 18, 2004 7:48 pm

Post by Alan » Tue Aug 12, 2008 2:02 pm

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

Post Reply