voice

new BookmarkLockedFalling
meerkat
Senior Member
****

meerkat Avatar

Posts: 250

Post by meerkat on Jan 14, 2016 8:16:57 GMT -5

There is a download for Firefox at link

For Chrome the following works.
You'll need to create a program called speech.bas and run it in your main program.

To run it from your main you need to pass the text in UserInfo$
Here is a gosub I use were it speaks your msg$ where the program is located in directory incdir$
'
--------------------------------
' Function Speak your msg$
' --------------------------------
[speech]
UserInfo$ = msg$
run incdir$;"speech.bas",#include
render #include
RETURN


The speech.bas program.

' --------------------------------------------------
' speech.bas
' Speaks text passed in UserInfo$
' the program clears itself after onend after speach is complete
' ---------------------------------------------------
CSSClass ".hide", "{visibility: hidden; height:0px; border:none}"
link #e, "end", [endIt]
#e cssclass("hide")
#e setid("canMe")
text$ = UserInfo$
html "<script>
speechSynthesis.cancel(u);
var u = new SpeechSynthesisUtterance();
u.text = '";text$;"';
u.lang = 'en-US';
u.rate = 1;
speechSynthesis.speak(u);
u.onend = function() {
speechSynthesis.cancel(u);
x = document.getElementById('canMe').click();
}
</script>"
wait
[endIt]
cls
end