|
-
Aug 26th, 2004, 07:18 AM
#1
Thread Starter
Fanatic Member
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
-
Aug 26th, 2004, 07:20 AM
#2
Something like this:
VB Code:
Private Sub Form_Load()
MsgBox "Good morning"
'Rest of the programm
End Sub
-
Aug 26th, 2004, 07:22 AM
#3
Thread Starter
Fanatic Member
Sorry I mean talk to me.
Thanks
Loftty
-
Aug 26th, 2004, 07:37 AM
#4
Thread Starter
Fanatic Member
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:
Option Explicit
Dim Speech As SpVoice
Private Sub Form_Load()
Set Speech = New SpVoice
Speech.Speak "good morning"
End Sub
Thanks
Loftty
-
Aug 26th, 2004, 08:08 AM
#5
Fanatic Member
This code looked very interesting loftty, but may I ask what reference you used? It's not working by the main commands of vb...
-
Aug 26th, 2004, 08:12 AM
#6
Thread Starter
Fanatic Member
Microsoft speech object libary
Loftty
-
Aug 26th, 2004, 10:39 AM
#7
Use the GetVoices method to see which voices are available.
Use the Voice property to change the voice..
-
Aug 26th, 2004, 11:18 AM
#8
Thread Starter
Fanatic Member
Could you show me the code for this please?
Thanks
Loftty
-
Aug 26th, 2004, 01:31 PM
#9
Thread Starter
Fanatic Member
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:
Option Explicit
Private WithEvents Speech As SpVoice
Private Sub Command1_Click()
Speech.Speak "Good morning"
End Sub
Private Sub Form_Load()
Set Speech = New SpVoice
Dim Token As ISpeechObjectToken ' create a token to hold the registry voice tokens
For Each Token In Speech.GetVoices
Combo1.AddItem (Token.GetDescription())
Next
Combo1.ListIndex = 0
End Sub
Private Sub ComboBoxVoices_Click()
Dim SOTokenVoice As ISpeechObjectToken 'create a SAPI token object
Set SOTokenVoice = Speech.Voice
'get the SAPI voice tokens out of the registry
Set Speech.Voice = speech1.GetVoices().Item(Combo1.ListIndex)
End Sub
-
Aug 26th, 2004, 01:47 PM
#10
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
-
Aug 26th, 2004, 01:52 PM
#11
Thread Starter
Fanatic Member
Where can I get these files? and what if I wanted to say someones name?
Thanks
Loftty
-
Aug 26th, 2004, 08:10 PM
#12
Hyperactive Member
If you just want to speak "Good morning" then record sound it will give yu nice sound quality
Regards,
Vishalgiri Goswami
Gujarat, ( INDIA ).
---------------------
-
Aug 26th, 2004, 11:20 PM
#13
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:
Private Sub [b]ComboBoxVoices[/b]_Click()
Dim SOTokenVoice As ISpeechObjectToken 'create a SAPI token object
Set SOTokenVoice = Speech.Voice
'get the SAPI voice tokens out of the registry
Set Speech.Voice = [b]speech1[/b].GetVoices().Item(Combo1.ListIndex)
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|