voice
voice copied to clipboard
Camera + SpeechToText not working together
What is needed ? I want to record a video and transcode voice to text for subtitles for example.
What's the problem ? When I record a video, the react-native-camera component use the microphone. But when i start the @react-native-community/voice in the same time to record audio and transcode voice to text, the Voice component stops immediately (it's using microphone too). If i add a timeout to the Voice component, the video record stops immediately. There is a solution to start 2 components using microphone in the same time synchronously ?
What I do ?
/* ... IMPORTS ... */
import { RNCamera, FaceDetector } from 'react-native-camera';
import Voice from '@react-native-community/voice';
const CameraScreen = (props) => {
/* ... CODE ... */
useEffect(() => {
function onSpeechStart() {
console.log('Speech START');
};
function onSpeechEnd() {
console.log('Speech END');
};
function onSpeechResults(e) {
console.log(e.value);
};
function onSpeechError(e) {
console.log(e);
};
Voice.onSpeechStart = onSpeechStart;
Voice.onSpeechEnd = onSpeechEnd;
Voice.onSpeechError = onSpeechError;
Voice.onSpeechResults = onSpeechResults;
return () => {
Voice.destroy().then(Voice.removeAllListeners);
};
}, []);
const cameraRecord = async () => {
await Voice.start('fr-FR');
camera.recordAsync({
quality: RNCamera.Constants.VideoQuality["1080p"],
orientation: "portrait"
})
.then(async (data) => {
console.log(data);
})
}
/* ... CODE ... */
return (
<View style={cameraStyle.container}>
{ /* ... RENDERING CODE ... */ }
</View>
)
}
export default CameraScreen;
Packages
- react-native: "0.63.3"
- react-native-camera: "git+https://[email protected]/react-native-community/react-native-camera.git"
- @react-native-community/voice: "^1.1.9"
Hi @saurus1993, I too face similar kind of problem. Did you get any solution?
Hi, i have same problem, did you get any solution? @saurus1993
any update on this? @AlkanV @sriram-23 @sebastien-abbal
Same problem but with react-native-audio-record, need to recognise and record audio at same time
Any solution to this? I'm currently facing the same issue, I'm using @react-native-community/voice for speech-to-text but also have to save the recordings and the said package can't handle it so I tried using react-native-audio-recorder-player to record the audio but found out it's not possible to use them simultaneously
Confirm. Not working with https://github.com/mrousavy/react-native-vision-camera
iOS - working, Android - "error": {"code": "7", "message": "7/No match"
Anyone run into a solution?