Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

126
Views
How to send audio segments to the API until user presses STOP

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 :

  1. user starts recording.

  2. the 5 seconds sound is recorded and sent to the API.

  3. again the point 2) until user presses STOP.

  4. user presses STOP.

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

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.

almost 4 years ago · Brayam Alexis Castro Correa Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!