quivr/frontend/lib/helpers/isSpeechRecognitionSupported.ts

11 lines
227 B
TypeScript
Raw Normal View History

export const isSpeechRecognitionSupported = (): boolean => {
if (
typeof window !== "undefined" &&
("SpeechRecognition" in window || "webkitSpeechRecognition" in window)
) {
return true;
}
return false;
};