MCPcopy Create free account
hub / github.com/cactus-compute/cactus-react-native / handleSelectAudio

Function handleSelectAudio

example/src/STTScreen.tsx:37–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected