Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

113
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda