I am developing in React Native. I need to classify sound segments in a Machine Learning API. The Model in this API accepts fragments of 5 seconds.
I would like to know what is the best way of implementing this in react native.
So far, I am recording the sound, using setTimeOut to define the 5 seconds of recording (defined 5 seconds). And the part of recording and sending until the user presses stop, I am handling with setInterval (defined 7 seconds).
The problem is, setInterval requires a time to repeat again, I put 7 seconds, and sometimes, it starts a new cycle when I am still recording the sound.So I am thowrn an error saying that I cant prepare two audio records at the same time.
How to control this?
Is there another way? I tryied using WHILE cycles, but without success.
So, the dynamics are :
user starts recording.
the 5 seconds sound is recorded and sent to the API.
again the point 2) until user presses STOP.
user presses STOP.
Hi, I'm doing something similar for my graduation project. I would like to know how you are doing with the audio issue and how you send it to the API. I'm starting on the React Native topic. but I don't know why the audio is not saved, it only generates the URL where it saves but not the file.