Failed to run in electron environment.
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.
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
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