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
node.js get part of a stream
const headers =  {
      'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36',
    }

headers['range'] = `bytes=${67638}-${91638920}`


    const stream = await axios.get(url, {
      responseType: 'stream',
      headers,
    }).then(s => {
      return s.data;
    });

 response.writeHead(206, {
          'Content-Type': 'audio/mpeg',
          'Accept-Ranges': 'bytes',
          'Content-Range': 'bytes ' + 67638 + '-' + 91638920 + '/' + 91638921,
          'Content-Length': 91638921,
        });
        stream.pipe(response);

I want to get the streaming part of an audio file. The result I want. I paste the address into the browser and the audio player opens and playback starts, but not from the first second For example, from 10 sec. That is, the player slider should be immediately at 10 seconds

about 4 years ago · Juan Pablo Isaza
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!