voice icon indicating copy to clipboard operation
voice copied to clipboard

React Native Screen Recorder and Voice Recogniser does not work together

Open alitele opened this issue 2 years ago • 0 comments

I am trying to use speech to text functionality in react native and while at the same time doing this i want to record the screen as well. I have implemented both libraries

react-native-record-screen and @react-native-community/voice which works fine only if i run one at a time and not work together. I am not sure if there is any clash internally over threads or code part on native sides of their modeules. I tried this on both android and iOS and results are same.

Below is the set of two functions that I use to start stop recording and speech to text

  const startRecording = async () => {
    try {
      await Voice.start('en-Us');
      await RecordScreen.stopRecording();
    } catch (error) {
       console.log('startRecording Error >>>>', error);
    }
  };
const stopRecording = async () => {
    try {
      await Voice.stop();
      await RecordScreen.stopRecording();
    } catch (error) {
      console.log('stopRecording Error >>>>', error);
    }
  };

Kindly suggest if there is any issue in implementation ? Appreciate you help.Thanks

alitele avatar Dec 03 '23 07:12 alitele