|
Description:
An example of using the MS Speech SDK to implement TTS (Text-To-Speech).
Source: Text Source
import sys
from win32com.client import constants
import win32com.client
speaker = win32com.client.Dispatch("SAPI.SpVoice")
print "Type word or phrase, then enter."
print "Ctrl+Z then enter (dos/win32) or Ctrl+D (unix) to exit."
while 1:
try:
s = raw_input()
speaker.Speak(s)
except:
if sys.exc_type is EOFError:
sys.exit()
Discussion:
This is fun, you could make a Dr. Sbaitso clone if you throw some Markov chains in.
|