android – React Native Screen Recorder and Voice Recogniser does not work together


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

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img