|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Text to SpeechSome time ago a messge was posted showing some simple code that one can use to convert text to speech using VB6. There was no question posted with the code so being curious I decided to try it. It worked fine. Now I have a couple of questions. The program uses the Microsoft Speech Object Library which I added as a reference in the VB6 program. To create the voice the following coding is used: Private SP As SpVoice Set SP = New SpVoice Then the following is used when a command button is clicked: Dim thetext as string thetext="Hello there" SP.Speak thetext This coding works fine but I would like to know how to determine when the speech is finished and also how to change the voice. I noticed that besides SP.Speak there is SP.WaitUntilDone and SP.Voice and others but do not know how to use them. Can someone give me some suggestions? Thank you. D. van Vianen "Doug van Vianen" <cour***@shaw.ca> wrote in message news:W50Qf.128361$H%4.59508@pd7tw2no...> Can someone give me some suggestions? Thank you. Does this help at all?http://msdn.microsoft.com/library/default.asp?url=/library/en-us/SAPI51sr/html/Welcome.asp Yeah, I typed in the VB code too. I also was not satisfied so
I did a litle research into the MS SAPI and found this page: http://www.microsoft.com/speech/download/sdk51/ There is a download for documentation (2.8). This might help you. Unfortunately other matter kept me moving forward with this, but it did pique my interest. I did notice thatthe All distrib files are 130MB. I compiled and generated a package for my tiny test app and the only component it added was the SAPI.DLL file. I too had a few questions, the first being if there was a way to build the text so that it could sound better. I tested with beak and steak Although both word have the ea vowels, their sound is different. The TTS did know to to pronounce each word correctly, although I wonder if it pronouced the author's name correctly, since it was an unconventional name (with respect to the English language). Good luck! Saga "Doug van Vianen" <cour***@shaw.ca> wrote in message news:W50Qf.128361$H%4.59508@pd7tw2no...Show quoteHide quote > Hi, > > Some time ago a messge was posted showing some simple code that one > can use to > convert text to speech using VB6. There was no question posted with > the code so > being curious I decided to try it. It worked fine. Now I have a couple > of questions. > > The program uses the Microsoft Speech Object Library which I added as > a > reference in the VB6 program. > > To create the voice the following coding is used: > > Private SP As SpVoice > Set SP = New SpVoice > > Then the following is used when a command button is clicked: > > Dim thetext as string > > thetext="Hello there" > SP.Speak thetext > > This coding works fine but I would like to know how to determine when > the speech is finished and also how to change the voice. I noticed > that > besides SP.Speak there is SP.WaitUntilDone and SP.Voice and others > but do not know how to use them. > > Can someone give me some suggestions? Thank you. > > D. van Vianen > >
Show quote
Hide quote
> Some time ago a messge was posted showing some simple code that one can Set the Voice property.use > to > convert text to speech using VB6. There was no question posted with the > code so > being curious I decided to try it. It worked fine. Now I have a couple of > questions. > > The program uses the Microsoft Speech Object Library which I added as a > reference in the VB6 program. > > To create the voice the following coding is used: > > Private SP As SpVoice > Set SP = New SpVoice > > Then the following is used when a command button is clicked: > > Dim thetext as string > > thetext="Hello there" > SP.Speak thetext > > This coding works fine but I would like to know how to determine when > the speech is finished and also how to change the voice. > I noticed that Speak has a second parameter:> besides SP.Speak there is SP.WaitUntilDone and SP.Voice and others > but do not know how to use them. > SpVoice.Speak( Text As String, [Flags As SpeechVoiceSpeakFlags = SVSFDefault] ) As Long The Flags parameter lets you adjust things like whether to finish speaking the current buffer before speaking new text. If you download the SAPI5.1 SDK you'll find there's a good help file with it. (Note that it only works on XP. You need to install the support files on other systems. All except Win95 can handle installing SAPI5 support.There are 3rd-party companies that provide installers of about 10 MB. Microsoft doesn't supply any installer at all. According to MS, if you want to ship SAPI you're supposed to download about 100 MB of merge modules and use them to make an MSI!)
problem formatting excel in vb
VB6 writing to text files requires Close to commit delete tmp files Collection of Radio buttons Function VB6 File Handling Without FSO Using VB to screen scrape a 3270 mainframe object variable or with block variable not set error Error to create a package in VB6 Close a form Find the Topmost window? |
|||||||||||||||||||||||