cfry / dde

Dexter Development Environment
Other
44 stars 25 forks source link

Human.speak doesn't in Ubuntu, and job hangs. #84

Open JamesNewton opened 2 years ago

JamesNewton commented 2 years ago

This sample job (from the help panel)

new Job({name: "j1",
         do_list: [
           Human.speak({speak_data: "hi there folks",
                        rate: 0.25,
                        wait: true}),
           IO.out("done")
         ]})

in Ubuntu 18.04, DDE 3.8.7,

  1. Doesn't produce any sound
  2. Causes the job to hang. I tried to debug it, but found the code confusing. It seems to execute the speech requirement, and then get suck in instruction.js in a jqx library?

It doesn't appear that DDE installs a text-to-speech package, and instead uses espeak on the robot and some native call otherwise? Perhaps I missed it in Package.json?

There dont' seem to be good alternatives which don't require the installation of other packages. https://www.npmjs.com/search?ranking=optimal&q=text-to-speech

but the key is that if it doesn't work, it shouldn't lockup the job.

cfry commented 2 years ago

DDE uses SpeechSynthesisUtterance https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance which is part of Web Speech API It works on Mac in Chrome in both DDE3 and DDE4 (browser based).

From https://askubuntu.com/questions/761975/chromium-is-not-generating-voice we see that Ubuntu/linux is deficient, but some pundits claim that overall the implementation is poor for many configurations.

https://dev.to/jankapunkt/cross-browser-speech-synthesis-the-hard-way-and-the-easy-way-353 claims to have a solution. Let's give this a try on your linux system and see if we can get it to work. I'm a bit reluctant to not use the web api standard, but if I can see where its erroring, quite possibly when calling: var msg = new SpeechSynthesisUtterance(); or var voices = window.speechSynthesis.getVoices(); or speechSynthesis.speak(msg)

If I wrap the offending call in a try catch, then, if it errors, we can catch it, then call the EasySpeech pkg from the above URL. Let's do this in our next call.

On Mon, Jul 25, 2022 at 2:44 PM JamesNewton @.***> wrote:

This sample job (from the help panel)

new Job({name: "j1", do_list: [ Human.speak({speak_data: "hi there folks", rate: 0.25, wait: true}), IO.out("done") ]})

in Ubuntu 18.04, DDE 3.8.7,

  1. Doesn't produce any sound
  2. Causes the job to hang. I tried to debug it, but found the code confusing. It seems to execute the speech requirement, and then get suck in instruction.js in a jqx library?

It doesn't appear that DDE installs a text-to-speech package, and instead uses espeak on the robot and some native call otherwise? Perhaps I missed it in Package.json?

There dont' seem to be good alternatives which don't require the installation of other packages. https://www.npmjs.com/search?ranking=optimal&q=text-to-speech

but the key is that if it doesn't work, it shouldn't lockup the job.

— Reply to this email directly, view it on GitHub https://github.com/cfry/dde/issues/84, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJBG7JLRG7GY563DWWMX3TVV3N7HANCNFSM54TIHQYQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>