(event: Event)
| 136 | }; |
| 137 | |
| 138 | const handleResult = (event: Event) => { |
| 139 | const speechEvent = event as SpeechRecognitionEvent; |
| 140 | let finalTranscript = ""; |
| 141 | |
| 142 | for ( |
| 143 | let i = speechEvent.resultIndex; |
| 144 | i < speechEvent.results.length; |
| 145 | i += 1 |
| 146 | ) { |
| 147 | const result = speechEvent.results[i]; |
| 148 | if (result.isFinal) { |
| 149 | finalTranscript += result[0]?.transcript ?? ""; |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | if (finalTranscript) { |
| 154 | onTranscriptionChangeRef.current?.(finalTranscript); |
| 155 | } |
| 156 | }; |
| 157 | |
| 158 | const handleError = () => { |
| 159 | setIsListening(false); |
nothing calls this directly
no outgoing calls
no test coverage detected