04-21-2023, 02:04 PM
Fun Fact #4 - You can call native Javascript from your QBJS program!
Here's a simple example that utilizes the browser's text-to-speech functionality:
Try it on QBJS!
Here's a simple example that utilizes the browser's text-to-speech functionality:
Code: (Select All)
Dim s As String
Print "What would you like me to say?"
Line Input s
Say s
Sub Say (text As String)
Dim success As Integer
$If Javascript Then
if (window.speechSynthesis) {
var utterance = new SpeechSynthesisUtterance(text);
window.speechSynthesis.speak(utterance);
success = -1;
}
$End If
If Not success Then
Print "Sorry, this is not supported in your browser."
End If
End Sub
Try it on QBJS!