I am attempting to find a way to take synthesized speech and record it to an audio file. I am currently using pyttsx as my text-to-speech library, but there isn\'t a mechani
Here is an example which gives you access to the NSSpeechSynthesizer API
#!/usr/bin/env python
from AppKit import NSSpeechSynthesizer
import sys
import Foundation
if len(sys.argv) < 2:
text = raw_input('type text to speak> ')
else:
text = sys.argv[1]
nssp = NSSpeechSynthesizer
ve = nssp.alloc().init()
ve.setRate_(100)
url = Foundation.NSURL.fileURLWithPath_('yourpath/test.aiff')
ve.startSpeakingString_toURL_(text,url)