erich.wanker Posted June 4, 2016 Posted June 4, 2016 i want to speech a text in chrome browser ... i use: unisession.AddJS(UTF8Encode('if ("speechSynthesis" in window) {var sagHallo = function() {var hallo = new SpeechSynthesisUtterance("'+unimainmodule.SILVANA_DB.FieldByName('TEXTAUSGABE').AsString+'");hallo.lang = "de-DE";window.speechSynthesis.speak(hallo);} }')); .. can someone help? thanx erich Quote
Sherzod Posted June 4, 2016 Posted June 4, 2016 Hi, Can you check whether there is in a string double quotes ?!: unimainmodule.SILVANA_DB.FieldByName('TEXTAUSGABE').AsString Best regards. Quote
erich.wanker Posted June 4, 2016 Author Posted June 4, 2016 hi delphi developer :-) checked it .. the string is: hello world no quotes... A demo works fine on my used browser: http://blog.sperrobjekt.de/content/1000435-Sprachausgabe-im-Browser-Das-Speech-Synthesis-API.html -> Button [sag "Hallo Welt" ] ThanX Erich Quote
erich.wanker Posted June 4, 2016 Author Posted June 4, 2016 hi, i collect the unigui-response ... what is going on when i start speech... _rsov_(O340,40);O378.setText("");var hallo = new SpeechSynthesisUtterance("hello world"); hallo.lang = "de-DE"; window.speechSynthesis.speak(hallo);O378.setText("Irgendwas mit: \"hi\"");O378.setText("Irgendwas mit: \"hi\" ohne fixem Themen-Bezug");_ffc_(O340);_sfv_(O340,40,"");O358.update(" Silvana meint:Halli hallo hallöchen :-)\n \n",true); Quote
erich.wanker Posted June 4, 2016 Author Posted June 4, 2016 IT Works :-) ... Now i use: UniHTMLFrame1.HTML.Append('<script type="text/javascript">'); UniHTMLFrame1.HTML.Append('var worte = new SpeechSynthesisUtterance("hello world");'); UniHTMLFrame1.HTML.Append('worte.lang = "de-DE";'); UniHTMLFrame1.HTML.Append('window.speechSynthesis.speak(worte);'); UniHTMLFrame1.HTML.Append('</script>'); ..its funny and easy to use in chrome and safari hth erich Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.