Library tutorials & articles

Text-To-Speech

How it works

This is how it works, when the button is clicked it says, "You clicked button number" and then it says the caption of the button. It then runs a program depending on which button you clicked. Also, when you type something in the text box it reads the text and speaks it out. Your form should look something like this:

If you run the program it should speak the caption of the button you clicked and run a program and if you type something in the text box it should speak what you typed.

Comments

  1. 16 Jul 2008 at 19:38

    I ran the program OK. When I create .exe and run on other computers, I get an error. What files are necessary to be installed on the other computers?

  2. 24 Mar 2007 at 06:30

    thanx for all the info u guys gave this helped me to learn how to use  the text-to-speech component
    the only thin i wanted to know was that how to make the lips move cause i had seen those lips move in my frinends pc.


  3. 14 Dec 2006 at 03:32

    hi,

    I would like to ask if it is possible to convert the text to spoken voice and save it inside a audio file such as .wav

    Thanks in advance

  4. 04 Aug 2005 at 07:14

    HI there you need install the text to speech engine and the Microsoft Reader.
    Text -to-Speech Engine installer and Microsoft Reader.


                                                                                                               Nolan F. Sunico
                                                                                                               Zamboanga City, Philippines

  5. 31 Jul 2005 at 17:19

    I have installed all prerequisites, added the speech Active X control to the project and installed the voice feature. The updated VB.NET 2003 is available at:


    http://cybereshop.lmhost2.com/frmSpeak.vb
    (the only difference from this file and the one above is that I have deleted all of the other buttons. )


    Please reply with the corrected code or what I should do.  Thank you.

  6. 30 Jul 2005 at 16:59

    I am using using the VB project available at:
    http://www.developerfusion.co.uk/show/1910/1/redir/


    I downloaded the Visual Studio File and run the file from Visual Studio.NET 2003 (it upgrades automatically).  After that I built the solution, type text in the text box and press the button- I don't hear the voice reading the text.  The other buttons just start an application; it suppose to speak what application is being launched.


    What I have done:
    I have installed Microsoft Speech program and I see the program in my control panel as the icon Speech.  I have tested the application from the control panel and I am able to hear words spoken.  Also, I have installed all prerequisites. I also have the speech Active X control enabled as well in Visual Studio.NET components.


    Please advise what I should do.  Thank you.

  7. 24 Nov 2004 at 05:41

    hi there
    i am working on this direct text to speech
    i have developed some code it working on some machines
    but on other machines i am not able to hear anything


    it was working my machine also but all of sudden i am not able to hear any thing
    can anyone telll me what could possibly be the reasson....


    it's very urgent
    please help me out...


  8. 02 Nov 2004 at 19:59

    Hi all,do you know where i can get the file sapi.h ????
    i really want it,plz help me!!

  9. 30 Aug 2004 at 17:28

    my email is ka_boom80@hotmail.com

  10. 27 Aug 2004 at 16:50

    im on xp tho

  11. 27 Aug 2004 at 16:49

    just silencee

  12. 06 Apr 2003 at 03:18

    Thank you for writing the code and thank you dragon flame for steering me in the right direction for the downloads required to make the code work. You all better be watching me now, this is what i needed to take over the world!

  13. 04 Apr 2003 at 10:55

    Hehe that tutorials fits me good =) my name is Alex to ( or my whole name is Alexander but everyone calls me Alex ;D ) hehe.. thats cool...i just had to post it =)

  14. 05 Dec 2002 at 04:34

    you can get the enfine from here.incase you are still searching for it.
    ">http://www.microsoft.com/products/msagent/downloads.htm#sr

  15. 25 Nov 2002 at 11:39

     OK heres the deal. for my grade 11 programming class we needed to find a topic and teach it to the class
    among the topics was text to speech.


          so i look about the internet searching for some tutorials  but find out that  the school here doesnt have the microsoft direct text to speech control


    and i was just wondering where i could find it weather it be on the VB installation CD or somewhere on the microsoft website.  



    thanks for your time

  16. 13 Nov 2002 at 06:22

    well here's my email and you can send me one too... thanks!
    juwave@hotmail.com

  17. 03 Jun 2002 at 16:54

    The code works just fine for me.  I'm running Win2000 and VB6.0.  Since I'm retiring towards the end of the year, I made a little form which shows me days, hours, minutes and seconds to go.  When the happy face is clicked, you get the same info in speech.

  18. 03 Jun 2002 at 11:03



    To many people seem to have a problem with this code.
    But there is nothing wrong with the code, it's to do with the drivers you downloaded.


    To fix this go to The Microsoft Download Page  and download the text - to - speach engines  and the SAPI 4.0 runtime support  and then it should work.


    Hope this helps.


    Please comment if it worked and if you don't understand or need help.  

  19. 22 May 2002 at 20:52

    The Visual Basic version should not matter.  I have the Developing for MS Agent book.  It gives examples for Text-to-speech in VB, C++, even HTML.  Some of the problem may be that Agent isnt loaded.  Do you see it in the notification area on the taskbar?



  20. 20 May 2002 at 15:18

     I have woked accordingly as per written instruction,but this component cant work.no sound is produce,how this is going to work?

  21. 25 Apr 2002 at 09:13

    thanks petrick, what sound card is compatible to that program.  I really really want to know because I'm very much interested to learn the text-to-speech because I want to apply the program to my system design and analysis defense, para kakaiba kami di ba!.  Thanks again!!!

  22. 22 Apr 2002 at 12:54

    Hi Ann, Do u already fixed d' problem 'bout d speech recognition program. I also have d same problem. Is it d sound card is not compatible? - Petrick

  23. 07 Apr 2002 at 07:13
  24. 07 Apr 2002 at 07:12

    Do you get any errors or just silence?

  25. 06 Apr 2002 at 21:39

    Hi there
            I am working on Win '98 and Visual Basic 6.0 ...with the suggested download components but the speech part is not workin.I have even downloaded the code with the tutorial but still it does not work.Can you plz suggest something that i can do to make the code work.


    My email add is mehul@gtemail.net


    Mehul


    PS:RASAP

  26. 23 Mar 2002 at 02:55

    i have downloaded the component for text to speech.i installed it but i am not getting the output or error.the application just works.the component is xvoice.dll and vb application is text to speech.vbp.
    can anyone tell me what is wrong

  27. 18 Mar 2002 at 05:14

    thisi  verry nice programm.But problem is i am not getting that compnent
    Microsoft direct text to speech controll in vb.
    plaease give inforamtion.

  28. 18 Mar 2002 at 02:21

    I guess you all have the wrong version of Visual Basic.
    When i was downloading the text-to-speech control from the Microsoft Speech website i sa this:


    Software Requirements:
    Microsoft Visual BasicĀ® 6.0 is needed to write applications incorporating SAPI automation, or for compiling the Visual Basic sample code. Since SAPI supports COM automation, other languages and...bla bla bla..


    Maybe that is the problem?


    Jackal salutes you..

  29. 17 Mar 2002 at 03:55

    It will not really work in Windows 95 as it is clearly defined on SAPI home page that Windows 95 and below is not supported.

  30. 13 Mar 2002 at 02:01

    didn't wok. error message METHOD 'Speak' of the object 'ITexttoSpeak' failed. what can I do?

  31. 23 Feb 2002 at 01:29

    Dear James,


    I have been solve this problem already! The Control didn't work because the matter of sound card and the configuration of the windows. Thank you for your responding.


    I have another question! how do i change the voice of this control from the man voice to woman voice????


    Regards,
    Mun Yoong

  32. 22 Feb 2002 at 13:38

    well you have to download all the stuff that was at the begenning of the TUT, then add those lips to your form lol.
    heres what i use for code... it looks like this


    spkSpeak.speak "Hello how are you"
    spkSpeak.speak = txtSayit.text


    stuff like that
    umm if you have msn msg me at zith321@hotmail.com

  33. 22 Feb 2002 at 05:15

    Hmmm.... I suggest you take a look at the Microsoft web site. As no error occurs, our code seems to be working fine; the Microsoft text-to-speech control just isn't saying anything.

  34. 22 Feb 2002 at 05:13

    Please describe the problem you are having....

  35. 22 Feb 2002 at 00:43

    If having problems with TTS (text to speech), make sure you have the speech engine properly registered and that your hardware specifications are appropriate. Check the proper setup in the Control Panel if you are running Windows 2000. Hope this helps a bit.

  36. 22 Feb 2002 at 00:15

    You say you can hear the speech, but i cannot? is it have any configure in the property or you have your own way to control this control. Please reply me. If can please share your code with me.  

  37. 22 Feb 2002 at 00:11

    Dear DeveloperFusion.com,


    The Text to speech totally can work at all!!!


  38. 22 Feb 2002 at 00:09

    I follow all the step that you give but no any speech or sound appear is it the property need to configure

  39. 05 Feb 2002 at 20:13

    When I click the buttons the program loads but there is no speech. Here is the code, if there is anything wrong with it please tell me.



    Const Notepad = "c:\windows\notepad.exe"
    Const Wordpad = "C:\Program Files\Windows NT\Accessories\wordpad.exe"
    Const Paint = "C:\WINDOWS\system32\mspaint.exe"
    Const Calculator = "c:\windows\system32\Calc.exe"
    Const Volume = "c:\windows\system32\Sndvol32.exe"
    Const InternetExplorer = "C:\Program Files\Internet Explorer\IEXPLORE.EXE"
    Const SoundRecorder = "c:\windows\system32\Sndrec32.exe"
    Const Clipboard = "c:\windows\system32\Clipbrd.exe"
    Const OutlookExpress = "C:\Program Files\Outlook Express\msimn.exe"
    Const Solitaire = "c:\windows\Sol.exe"


    Private Sub BtnNumbers_Click(Index As Integer)


    spkSpeak.Speak "You clicked button number " & BtnNumbers(Index).Caption & "."


    Select Case Index + 1
     Case Is = 1
       Shell Notepad, vbNormalNoFocus
     Case Is = 2
       Shell Wordpad, vbNormalNoFocus
     Case Is = 3
       Shell Paint, vbNormalNoFocus
     Case Is = 4
       Shell Calculator, vbNormalNoFocus
     Case Is = 5
       Shell Volume, vbNormalNoFocus
     Case Is = 6
       Shell InternetExplorer, vbNormalNoFocus
     Case Is = 7
       Shell SoundRecorder, vbNormalNoFocus
     Case Is = 8
       Shell Clipboard, vbNormalNoFocus
     Case Is = 9
       Shell OutlookExpress, vbNormalNoFocus
     Case Is = 10
       Shell Solitaire, vbNormalNoFocus
    End Select


    End Sub


    Private Sub BtnSpeak_Click()


    spkSpeak.Speak txtText.Text


    End Sub




    Thanks

  40. 05 Feb 2002 at 13:01

    Is there any way to make it speak in a disserent language than English?

  41. 05 Feb 2002 at 12:20

    I tried the text to speech control.But its not working.Any suggestions on possible reasons for the failure???????


    U can mail me at vimal_666@yahoo.com.Plzzz include text to speech as the subject line.(plzzzzzzzz)

  42. 05 Feb 2002 at 01:03

    that was simply great, i can easily say that, very comprehensive. AND VERY TO THE POINT. I give my cheers to the author, for that, maybe im being melodramitic? well, that was great., i understood everything first time around, and in the text box, i wrote the lyrics to sum 41 "fat lip" song . one thing, how do i change that crappy voice??? can you email me or reply to this message when you get around to it?
    Zith321@hotmail.com

  43. 29 Jan 2002 at 00:30

    well here's my email and you can send me one too... thanks!


    shanesegui@yahoo.com

  44. 27 Jan 2002 at 10:48

    I can e-mail you the project too but i'll need your e-mail adrress.



    Alex

  45. 25 Jan 2002 at 21:59

    I typed in the text to speech tutorial but can not to get any speech.  The applications run when clicking the numbered buttons but no speech.  The text in the text box is not spoken either when clicking the Speak command button.  I added a Beep to the click events to test the sound card, volume etc. and it works fine.  I compiled it and it worked fine on Windows2000.  Any suggestions as to why it does not work on Windows 95 would be helpful.

  46. 25 Jan 2002 at 02:49

    Yeah please send it to me too!  This could be a really cool project.  I could even freak out my VB teacher.
    Oh yeah, an email address might help too.  Email me at thats_right2@yahoo.com.  Thanks

  47. 23 Jan 2002 at 06:38

    Alex, can you send me an example, my e-mail address is: njtermite@yahoo.com


    thanks
    mark

  48. 15 Jan 2002 at 23:06

    no worrrys

  49. 15 Jan 2002 at 12:56

    thanks for the tip,


    bill

  50. 14 Jan 2002 at 23:53

    hey,


    i just stumbled apon your query about the text-to-speech thing. I dont know much about your problem but if I can help you out of a little problem you may have later on if you distribute your application/code. Always deter from using C:\Windows or C:\Program Files\ when linking/shelling applications. Why? Well firstly not all Windows OS's are the same and its because NT and 9x are different.


    Lets take a look at C:\Windows first.... in Windows NT(4/2000) its not that but rather C:\WinNT which will mean that your program will not be 'NT Compatible' so I recommend you using API to workout the important Windwos Directories to get the common folders. I ahve attaced below some code which I use regularly on my work.


    '// Start
    Option Explicit ' DIE TYPO's DIE
    Private Declare Function GetWindowsDirectoryB Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
    Private Declare Function GetSystemDirectoryB Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal Path As String, ByVal cbBytes As Long) As Long
    Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
    Private Const MAXLENGTH = 512
    Public Function GetWindowsSystemDirectory() As String
       Dim s As String
       Dim c As Long
       s = String$(MAX
    LENGTH, 0)
       c = GetSystemDirectoryB(s, MAXLENGTH)
       If c > 0 Then
           If c > Len(s) Then
               s = Space$(c + 1)
               c = GetSystemDirectoryB(s, MAX
    LENGTH)
           End If
       End If
       GetWindowsSystemDirectory = IIf(c > 0, Left$(s, c), "")
    End Function
    Public Function GetWindowsDirectory() As String
       Dim s As String
       Dim c As Long
       s = String$(MAXLENGTH, 0)
       c = GetWindowsDirectoryB(s, MAX
    LENGTH)
       If c > 0 Then
           If c > Len(s) Then
               s = Space$(c + 1)
               c = GetWindowsDirectoryB(s, MAXLENGTH)
           End If
       End If
       GetWindowsDirectory = IIf(c > 0, Left$(s, c), "")
    End Function
    Public Function GetTempDirectory() As String
       Dim s As String
       Dim c As Long
       s = Space$(MAX
    LENGTH)
       c = GetTempPath(MAXLENGTH, s)
       If c > 0 Then
           If c > Len(s) Then
               s = Space$(c + 1)
               c = GetTempPath(MAX
    LENGTH, s)
           End If
       End If
       GetTempDirectory = IIf(c > 0, Left$(s, c), "")
    End Function


    hope this helps you out in the long run! that was just a helpful hint so dont take it as an offence as another guy did on here when i told them.

  51. 14 Jan 2002 at 21:08

    Const Notepad = "c:\windows\notepad.exe"
    Const Wordpad = "C:\program files\accessories\Wordpad.exe"
    Const Paint = "c:\windows\Pbrush.exe"
    Const Calculator = "c:\windows\Calc.exe"
    Const Volume = "c:\windows\Sndvol32.exe"
    Const InternetExplorer = "C:\Program Files\Internet Explorer\Iexplore.exe"
    Const SoundRecorder = "c:\windows\Sndrec32.exe"
    Const Clipboard = "c:\windows\Clipbrd.exe"
    Const Dialer = "c:\windows\Dialer.exe"
    Const Solitaire = "c:\windows\Sol.exe"
    Private Sub DirectSS1_ClickIn(ByVal x As Long, ByVal y As Long)


    End Sub


    Private Sub btnNumbers_Click(Index As Integer)
    spkSpeak.Speak "You clicked button number " & btnNumbers(Index).Caption & "."
    Select Case Index + 1
     Case Is = 1
       Shell Notepad, vbNormalNoFocus
     Case Is = 2
       Shell Wordpad, vbNormalNoFocus
     Case Is = 3
       Shell Paint, vbNormalNoFocus
     Case Is = 4
       Shell Calculator, vbNormalNoFocus
     Case Is = 5
       Shell Volume, vbNormalNoFocus
     Case Is = 6
       Shell InternetExplorer, vbNormalNoFocus
     Case Is = 7
       Shell SoundRecorder, vbNormalNoFocus
     Case Is = 8
       Shell Clipboard, vbNormalNoFocus
     Case Is = 9
       Shell Dialer, vbNormalNoFocus
     Case Is = 10
       Shell Solitaire, vbNormalNoFocus
    End Select
    End Sub


    Private Sub btnSpeak_Click()
    spkSpeak.Speak txtText.Text


    End Sub


    Private Sub Form_Load()


    End Sub


    Private Sub spkSpeak_ClickIn(ByVal x As Long, ByVal y As Long)


    End Sub


    Private Sub txtText_Change()


    End Sub



    Thanks for helping me...

  52. 14 Jan 2002 at 01:33

    I'd be happy to look at your code if you either e-mail me the project or else paste it into the Message of a reply. Either way I'll let you know what's wrong. -Dave.

  53. 14 Jan 2002 at 01:22

    No run time error.. I mean the command buttons open up the programs it should. But i do not hear any voice communication.. Do I have to change any settings?

  54. 10 Jan 2002 at 15:53

    Thank you for the tutorial. I have just one question: Is there a chance to save the spoken text in a wave-file or in an other type of audio file?


    Martina.

  55. 09 Jan 2002 at 03:31

    Do you receive a runtime error? I never had any trouble with my program.

  56. 08 Jan 2002 at 18:36

    Whenever i try to have my text to be spoken, it never does.. I followed the instructions.. Anything wrong?

  57. 06 Jan 2002 at 16:17

    I am trying to find the code I need to write that would allow me to change the default voice using tts. Right now I get the standard monotone voice. I'd like to use a female voice in my program. I have looked at the property .currentMode, etc. I keep getting runtime errors. This is what I receive: "Class does not support Automation or does not support expected interface". Can someone please tell me what that means. Are there any good books on tts or speech-recognition? My HELP doesn't support these technologoies. Perhaps there is a way I can incorporate the help for these into VB6? Any help here is appreciated.

  58. 06 Jan 2002 at 10:13

    Hi,


    You can adjust the pitch, volume and age to get a different voice I think. You may also be able to download different voices from the microsoft website.



    Alex

  59. 06 Jan 2002 at 03:00

    How can I add a different voice into my text-to-speech program?

  60. 05 Jan 2002 at 13:58

    There is a control that came with the package you downloaded. It is the microsoft direct speech recognition control. I can give you an example of what it can do. I'll mail it to you if you give me your e-mail address.



    Alex

  61. 30 Dec 2001 at 08:07

    Love It Just Love it. I am just starting out too, and I started to go step by step and I would just get a bit flusered! And kept walking away. But I came back, sat down, followed everything step by step and BOOM! It workd! Love it. Thanks to this site, the learning has started for me. Thats great!  Now I have one I REALLY REALLY Need help on. I had downloaded this program called Talk 2 Desktop. You could name files things and when you spoke them into a mic, it would open the program you set the spoken name for. The part I loved about it was, you could put in what you wanted the little ms agent to say once the program you slected opened. What I am looking for is this.. (if anyone can help me with this I would be soooooo greatfull.) All I want is a simple program that when you say a word or phrase to it, it will say what ever you set it to for that spoken key word. The talk 2 desktop worked great in this feature in the macros section of the program, but all of a sudden it started comming up with runtime errors and the software makers had no answers for me. So I am stuck!!!!! All I want to be able to do is say a keyword like "Hello computer" and it would say "Hello human" or what ever. Can anyone help me? If this simple text to speech was this easy to do, is what I want to do just as easy?

  62. 18 Dec 2001 at 02:21

    nice tutorial. but  i can't make it speak... im just beginning to learn direct speech.
    'guess i have to dig more... hehe .. thanks anyway.



    shaneski

  63. 01 Jan 1999 at 00:00

    This thread is for discussions of Text-To-Speech.

Leave a comment

Sign in or Join us (it's free).

AddThis

Related discussion