(filePath: string)
| 44 | }; |
| 45 | |
| 46 | const readAudioFile = async (filePath: string): Promise<Uint8Array> => { |
| 47 | const base64Audio = await RNFS.readFile(filePath, 'base64'); |
| 48 | const binaryString = atob(base64Audio); |
| 49 | const bytes = new Uint8Array(binaryString.length); |
| 50 | for (let i = 0; i < binaryString.length; i++) { |
| 51 | bytes[i] = binaryString.charCodeAt(i); |
| 52 | } |
| 53 | // Skip WAV header (44 bytes) |
| 54 | return bytes.slice(44); |
| 55 | }; |
| 56 | |
| 57 | const handleStreamTranscribe = async () => { |
| 58 | if (!audioFile) return; |
no test coverage detected