Results 1 to 13 of 13

Thread: Speak at start of program

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    england
    Posts
    598

    Speak at start of program

    Hi all,

    How can I have program say "good morning" when it starts? what steps do I need for this?

    Thanks

    Loftty

  2. #2
    Frenzied Member Lightning's Avatar
    Join Date
    Oct 2002
    Location
    Eygelshoven
    Posts
    1,611
    Something like this:

    VB Code:
    1. Private Sub Form_Load()
    2. MsgBox "Good morning"
    3.  
    4. 'Rest of the programm
    5. End Sub
    VB6 & C# (WCF LINQ) mostly


    If you need help with a WPF/WCF question post in the NEW WPF & WCF forum and we will try help the best we can

    My site

    My blog, couding troubles and solutions

    Free online tools

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    england
    Posts
    598
    Sorry I mean talk to me.

    Thanks

    Loftty

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    england
    Posts
    598
    I have got it so it will say good morning but it says it in one voice is there a way where I can change the voice?

    I have used this code with a refrence to Microsoft speech.

    VB Code:
    1. Option Explicit
    2. Dim Speech As SpVoice
    3.  
    4. Private Sub Form_Load()
    5. Set Speech = New SpVoice
    6. Speech.Speak "good morning"
    7.  
    8. End Sub

    Thanks

    Loftty

  5. #5
    Fanatic Member Ruku's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    655
    This code looked very interesting loftty, but may I ask what reference you used? It's not working by the main commands of vb...

    Using VB.NET 2005/.NET 2.0, NetBeans IDE 5, Fujitsu Cobol85,
    Website: http://DreamForgery.com

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    england
    Posts
    598
    Microsoft speech object libary

    Loftty

  7. #7
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    Use the GetVoices method to see which voices are available.
    Use the Voice property to change the voice..

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    england
    Posts
    598
    Could you show me the code for this please?

    Thanks

    Loftty

  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    england
    Posts
    598
    I have used this code which lists all the voices I have but when I click on one and press the button it does noy change the voice, what should I be doing here?

    Thanks

    Loftty

    VB Code:
    1. Option Explicit
    2.  
    3. Private WithEvents Speech As SpVoice
    4.  
    5. Private Sub Command1_Click()
    6.  
    7.    Speech.Speak "Good morning"
    8.  
    9. End Sub
    10.  
    11.  
    12. Private Sub Form_Load()
    13.  
    14.    Set Speech = New SpVoice
    15.    Dim Token As ISpeechObjectToken ' create a token to hold the registry voice tokens
    16.    
    17.    For Each Token In Speech.GetVoices
    18.         Combo1.AddItem (Token.GetDescription())
    19.    Next
    20.    
    21.    Combo1.ListIndex = 0
    22.  
    23. End Sub
    24.  
    25. Private Sub ComboBoxVoices_Click()
    26.  
    27.   Dim SOTokenVoice As ISpeechObjectToken 'create a SAPI token object
    28.   Set SOTokenVoice = Speech.Voice
    29.   'get the SAPI voice tokens out of the registry
    30.   Set Speech.Voice = speech1.GetVoices().Item(Combo1.ListIndex)
    31.  
    32. End Sub

  10. #10
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787
    why not get a sound file off the net, which says good morning and load it using the playsound api or the windows media referance

  11. #11

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    england
    Posts
    598
    Where can I get these files? and what if I wanted to say someones name?

    Thanks

    Loftty

  12. #12
    Hyperactive Member Vishalgiri's Avatar
    Join Date
    Oct 2003
    Location
    India
    Posts
    345
    If you just want to speak "Good morning" then record sound it will give yu nice sound quality
    Regards,
    Vishalgiri Goswami
    Gujarat, ( INDIA ).
    ---------------------

  13. #13
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    I have used this code which lists all the voices I have but when I click on one and press the button it does noy change the voice, what should I be doing here?
    Based on what you posted, there are some errors.

    VB Code:
    1. Private Sub [b]ComboBoxVoices[/b]_Click()
    2.  
    3.   Dim SOTokenVoice As ISpeechObjectToken 'create a SAPI token object
    4.   Set SOTokenVoice = Speech.Voice
    5.   'get the SAPI voice tokens out of the registry
    6.   Set Speech.Voice = [b]speech1[/b].GetVoices().Item(Combo1.ListIndex)
    7.  
    8. End Sub

    ComboBoxVoices should be Combo1
    Speech1 should be Speech.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width