Hi all,
How can I have program say "good morning" when it starts? what steps do I need for this?
Thanks
Loftty
Printable View
Hi all,
How can I have program say "good morning" when it starts? what steps do I need for this?
Thanks
Loftty
Something like this:
VB Code:
Private Sub Form_Load() MsgBox "Good morning" 'Rest of the programm End Sub
Sorry I mean talk to me.
Thanks
Loftty
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
This code looked very interesting loftty, but may I ask what reference you used? It's not working by the main commands of vb... :(
Microsoft speech object libary
Loftty
Use the GetVoices method to see which voices are available.
Use the Voice property to change the voice..
Could you show me the code for this please?
Thanks
Loftty
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
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 :)
Where can I get these files? and what if I wanted to say someones name?
Thanks
Loftty
If you just want to speak "Good morning" then record sound it will give yu nice sound quality
Based on what you posted, there are some errors.Quote:
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?
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.