()
| 35 | }; |
| 36 | |
| 37 | const handleSelectAudio = async () => { |
| 38 | try { |
| 39 | const res = await DocumentPicker.pick({ |
| 40 | type: [DocumentPicker.types.audio], |
| 41 | }); |
| 42 | if (res && res.length > 0) { |
| 43 | const fileName = `audio_${Date.now()}.wav`; |
| 44 | const destPath = `${RNFS.CachesDirectoryPath}/${fileName}`; |
| 45 | await RNFS.copyFile(res[0].uri, destPath); |
| 46 | setAudioFile(destPath); |
| 47 | setAudioFileName(res[0].name || 'Unknown'); |
| 48 | } |
| 49 | } catch (err) { |
| 50 | console.error(err); |
| 51 | } |
| 52 | }; |
| 53 | |
| 54 | const handleTranscribe = async () => { |
| 55 | if (!audioFile) { |
nothing calls this directly
no outgoing calls
no test coverage detected