gittyeric / FAlexa

Create your own verbal commands that fuzzily map to custom Javascript / Typescript functions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Running Initial Demo Error – window is not defined

benjamingordon27 opened this issue · comments

var getSynth = function () { return window !== undefined ? window.speechSynthesis : {}; };

It looks as if it's an issue with default speaker. Attached is a picture of the error. I was wondering if you think you know what that might mean. It seems as if it has to do with a microphone issue.

Thank you!
referenceerror

Apologies for never noticing this till now. "window" is a global that exists in every browser runtime, but it's called "global" in Node.js. I should change this to check for globalThis.speechSynthesis instead as described here: https://javascript.info/global-object . If only globalThis existed when I wrote this! I can add this if you need it but also check out "Front End Installation" in the README to guarantee that "window" resolves.