MCPcopy Create free account
hub / github.com/MagicCube/agentara / detectSpeechInputMode

Function detectSpeechInputMode

web/src/components/ai-elements/speech-input.tsx:75–89  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73};
74
75const detectSpeechInputMode = (): SpeechInputMode => {
76 if (typeof window === "undefined") {
77 return "none";
78 }
79
80 if ("SpeechRecognition" in window || "webkitSpeechRecognition" in window) {
81 return "speech-recognition";
82 }
83
84 if ("MediaRecorder" in window && "mediaDevices" in navigator) {
85 return "media-recorder";
86 }
87
88 return "none";
89};
90
91export const SpeechInput = ({
92 className,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected