spoken icon indicating copy to clipboard operation
spoken copied to clipboard

Failed to run in electron environment.

Open chroma9 opened this issue 5 years ago • 2 comments

When running in a test environment for Electron, spoken runs into an error quickly. Here is the code used.

spoken.listen.on.start( voice => { console.log('Started Listening') } );
spoken.listen.on.end(   voice => { console.log('Ended Listening')   } );
spoken.listen.on.error( voice => { console.log('Error Listening', voice)   } );
spoken.listen.on.partial( ts => console.log(ts) );
spoken.listen()
    .then(     ts => console.log("Partial: " + ts) )
    .catch( error => console.warn(error.message)   )

I then received the following error.

bubbles: false
cancelBubble: false
cancelable: false
composed: false
currentTarget: SpeechRecognition {grammars: SpeechGrammarList, lang: "en-US", continuous: false, interimResults: true, maxAlternatives: 1, …}
defaultPrevented: false
error: "network"
eventPhase: 0
isTrusted: true
message: ""
path: []
returnValue: true
srcElement: SpeechRecognition {grammars: SpeechGrammarList, lang: "en-US", continuous: false, interimResults: true, maxAlternatives: 1, …}
target: SpeechRecognition {grammars: SpeechGrammarList, lang: "en-US", continuous: false, interimResults: true, maxAlternatives: 1, …}
timeStamp: 472.00499998871237
type: "error"

I hope you can get back to me.

chroma9 avatar Sep 24 '20 01:09 chroma9

error: "network" looks like may be a permissions issue. In electron config/system this may be needed: https://www.electronjs.org/docs/api/system-preferences#systempreferencesgetmediaaccessstatusmediatype-windows-macos

stephenlb avatar Sep 25 '20 20:09 stephenlb

https://stackoverflow.com/questions/47226889/speechrecognition-network-error-when-working-with-electron-chromium-browser

Everything must be done over HTTPS to allow this technology to work.

HTTPS details: https://github.com/stephenlb/spoken#speech-to-text

stephenlb avatar Sep 26 '20 00:09 stephenlb