Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SAPI Record to a WAV

Status
Not open for further replies.

CasperTFG

Programmer
Joined
Nov 15, 2001
Messages
1,210
Location
US
I am able to get the SAPI saying some words. What I need now is for it to record to a file.

Does anyone know how I can do this.

On my Project I have a Text Box, Combo Box, Command Button, Slider Bar and Microsoft Voice Text Control. Here's the code.

Private Sub Form_Load()
Dim strVoiceType As String
Dim intEngine As Integer
Dim i As Integer
intEngine = TextToSpeech1.Find("")
TextToSpeech1.Select intEngine
For i = 1 To TextToSpeech1.CountEngines
strVoiceType = TextToSpeech1.ModeName(i)
Combo1.AddItem strVoiceType
Next i
Combo1.ListIndex = TextToSpeech1.CurrentMode - 1
End Sub

Private Sub speak1()
On Error GoTo ErrHandler

TextToSpeech1.Select Combo1.ListIndex + 1
TextToSpeech1.Speed = Slider1.Value
Me.Caption = Combo1.Text & " @ " & TextToSpeech1.Speed

TextToSpeech1.Speak Text1.Text

Exit Sub
ErrHandler:
MsgBox "This voice is not properly Loaded, Please try another voice", vbOKOnly
End Sub


Private Sub Command1_Click()
speak1
End Sub





Casper

"I feel sorry for people who don't drink. When they wake up in the morning, that's as good as they're going to feel all day."
~Frank Sinatra
 
FYI...

I've left doing it this way and decided to go with SAPI 5.1. It is much more robust, the one problem is using the TextToSpeech control in VB I was able to get about 30 different voices. With SAPI 5.1 I only have 3.

If anyone has worked with SAPI before and knows how to get those extra voices loaded into 5.1, please let me know.

Casper

"I feel sorry for people who don't drink. When they wake up in the morning, that's as good as they're going to feel all day."
~Frank Sinatra
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top