Talk:Text to Speech

From Valve Developer Community
Jump to: navigation, search

Interesting. Do you have any sound-samples? --dutchmega 10:34, 14 Aug 2006 (PDT)

Dutchmega, in my user page is a link to a News at Seven page that has a video of our current system; it uses the same TTS stuff as the code in this page. You can watch the video (it's less than 20 megs, I believe) to get a good idea of how good the voices can sound. The only modification we're doing right now to the stock SAPI speech is a small, hardcoded dictionary of transformations for hard-to-pronounce phrases (ie, 'al Qaeda' becomes 'all chi de', etc.) In the future, we have plans to vary the speech produced based on the content/affectation of the text, but right now it's just basic TTS. If I get a chance, I'll post some actual sound samples later. Thanks.--Ndnichols 07:05, 21 Aug 2006 (PDT)

Help! Errors!

I followed the instuctions on the page (I installed all of the required stuff).

I imported the hl2TTS module into python, but when i went to do the creation of the .wav (hl2TTS.StraightForwardRecord("The quick brown fox jumped over the lazy dog.", "c:\\test")) i get the error

"Traceback (most recent call last):

 File "<interactive input>", line 1, in ?
 File "hl2TTS.py", line 331, in StraightForwardRecord
   RecordWAV(safeFilename, text)
 File "hl2TTS.py", line 79, in RecordWAV
   wordTimings = GetTimings(text)
 File "hl2TTS.py", line 98, in GetTimings
   wordTimings[-1].append([event.CurrentID, event.NextID, event.Duration])

IndexError: list index out of range"

The .wav is created, but it is not linked with any phenomes when I open it with FacePoser.

Sorry about that. It looks like some voices (the Microsoft ones specifically) raise events in a slightly different order (you can see the comments in GetTimings() if you're interested.) It should be fixed now. You are using a Microsoft voice, right? I updated hl2TTS.py, try downloading it again and seeing if it works. Let me know how it goes, please, the only changed thing is GetTimings(). Thanks for playing with it, I hope it works now.--Ndnichols 14:03, 25 Sep 2006 (PDT)