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

108
Views
Can't get my audio stream to Play in Browser

I'm capturing a PCI WAV live audio stream from a microphone on a remote computer. Sampling rate of 44100 in a Mono16 format. I'm grabbing 250ms chunks into a short[] buffer and transferring it to a server. The server captures the "chunks" and assembles them into a playable Wav file.(just for testing, So i know the data makes it to the server correctly). I'm trying to then send the unaltered "chunks" to a web page and want to play them back using the AudioContext. I've tried every example i can find and i cannot get the AudioContext to even make even a beep, nothing not a sound. no errors thrown either.

Here's my latest attempt of many......Any help would be appreciated.

var context = new AudioContext();

connection.on("SendBuffer", function (user, bufferchunk) {
    playByteArray(bufferchunk);
});

connection.start().then(function () {

}).catch(function (err) {
    return console.error(err.toString());
});


function playByteArray(bytes) {
    var buffer = new Uint16Array(bytes.length);
    buffer.set(new Uint16Array(bytes), 0);

    context.decodeAudioData(buffer.buffer, play);
}

function play(audioBuffer) {
    var source = context.createBufferSource();
    source.buffer = audioBuffer;
    source.connect(context.destination);
    source.start(0);
}
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!