We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8df1e51 commit 0ad5c9fCopy full SHA for 0ad5c9f
components/Chat.tsx
@@ -60,12 +60,12 @@ export function Chat() {
60
const [isListening, setIsListening] = useState(false)
61
62
const toggleSpeechRecognition = () => {
63
- if (!('webkitSpeechRecognition' in window) && !('SpeechRecognition' in window)) {
+ if (!('webkitSpeechRecognition' in (window as any)) && !('SpeechRecognition' in (window as any))) {
64
alert('お使いのブラウザは音声認識に対応していません。Google Chromeをお試しください。')
65
return
66
}
67
68
- const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
+ const SpeechRecognition = (window as any).SpeechRecognition || (window as any).webkitSpeechRecognition;
69
70
const recognition = new SpeechRecognition()
71
recognition.lang = 'ja-JP'
0 commit comments