Visual Basic - DirectSR1.GrammarFromString

Life is soft - evento anual de software empresarial
 
Vista:

DirectSR1.GrammarFromString

Publicado por dallari (1 intervención) el 23/09/2005 16:24:40
como hago para codificar el DirectSR1.GrammarFromString favor enviar respuesta a la direccion de correo
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:DirectSR1.GrammarFromString

Publicado por baltazar quiroz torrealva (2 intervenciones) el 24/11/2006 23:38:50
AMIGO, PORFAVOR AYUDAME, A QUE EL ORDENADOR ESCUCHE Y RECONOZCA MI VOZ EN ESPAÑOL, EN UN EJEMPLO EN VISUAL BASIC 6.0.

POR EJEMPLO YO DECIRLE AL COMPUTADOR:

1. QUE SE APAGUE. (y el computador se apague)
2. MUSICA (y el computador cargue el reproductor de sonido)

Pero todas estas palabras en Español.


Y SI PUEDES TAMBIEN ENSEÑARME A USAR LOS AGENTES DE DE VOZ, QUE ESTOS TRADUSCAN UN IDIOMA A OTRO.

Y SI TIENES UN CURSO Q DICTAS, DIME SI ME PUEDO INSCRIBIR.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:DirectSR1.GrammarFromString

Publicado por dexter (1 intervención) el 23/08/2007 13:36:54
Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal _
lpOperation As String, ByVal lpFile As String, ByVal _
lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long

Private Sub Command1_Click()
Select Case Command1.Caption
Case Is = "Desactivar"
DirectSR1.Deactivate
Command1.Caption = "Activar"

Case Is = "Activar"
DirectSR1.Activate
Command1.Caption = "Desactivar"

End Select
End Sub

Private Sub DirectSR1_PhraseFinish(ByVal flags As Long, _
ByVal beginhi As Long, ByVal beginlo As Long, ByVal endhi As Long, _
ByVal endlo As Long, ByVal Phrase As String, ByVal parsed As String, _
ByVal results As Long)

Dim sFile As String
Dim noth As Long

Select Case Phrase
Case "bloc"
archi = "C:\Windows\System32\notepad.exe"
ejecuta = Shell(archi, 1)
Case "kal"
archi = "C:\Windows\System32\calc.exe"
ejecuta = Shell(archi, 1)
Case "paint"
archi = "C:\Windows\System32\mspaint.exe"
ejecuta = Shell(archi, 1)
End Select

If Phrase <> "" Then
Label1.Caption = "Palabra pronunciada " & Phrase
DirectSS1.Speak Phrase
Else
Label1.Caption = "No entiendo"
DirectSS1.Speak "No entiendo"
End If
End Sub

Private Sub Form_Load()
Dim totaldata As String
DirectSR1.GrammarFromString "[Grammar]" + vbNewLine + _
"type=cfg" + vbNewLine + _
"[<start>]" + vbNewLine + _
"<start>=rojo" + vbNewLine + _
"<start>=azul" + vbNewLine + _
"<start>=verde" + vbNewLine + _
"<start>=a" + vbNewLine + _
"<start>=e" + vbNewLine + _
"<start>=i" + vbNewLine + _
"<start>=o" + vbNewLine + _
"<start>=u" + vbNewLine + _
"<start>=bloc" + vbNewLine + _
"<start>=paint" + vbNewLine + _
"<start>=kal" + vbNewLine

DirectSR1.Activate
Command1.Caption = "Desactivar"
DirectSS1.Speak "Este programa por Dexter"
Label1.Caption = ""
End Sub
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar