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

326
Views
Node.js save audio file from mediaserver

Currently I have two node.js servers connected (server1 & server2). I'm trying to get an audio file (.wav) that is saved on server1 to server2 and save it as a file on server2. I have it setup right now using mediaserver.

On server1...

ms = require('mediaserver');

app.get(/audio, function(req, res){
  ms.pipe(req, res, "/example.wav");
});

This works when I try to receive it with a standard html file using

<audio controls>
    <source src="/audio" type="audio/wav">
    Your browser does not support the audio element.
</audio>

How would I receive it and save it on server2, though. I've tried without success to write it like it was a binary file using

axios
  .get('/audio', {})
  .then(res => {
    fs.writeFile('received.wav', res.data, function(err) {
      // etc
    });
  })

Also, it may be of note that it is a 2 channel audio file with a rate of 16000.

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!