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

221
Visualizações
Concat stream audio buffers into one file and store it

I was using the Google Cloud Speech to recognize streaming audios (from microphone) on the node server. At the same time I would like to store the streamed audio into a file. Since the streaming recognition is operated on chunks of buffers, how could I combine all the buffers and store it as a single audio file?

The actual code I was using is adapted from this library, where the audio encoding on the server side is defined as

const encoding = 'LINEAR16';
const sampleRateHertz = 16000;

And each time there's a audio stream it will be sent via the cloud api:

client.on('binaryData', function (data) {
    if (recognizeStream !== null) {
      recognizeStream.write(data);
    }
  });

On the client side, the buffer was preprocessed in this file (downsampled into a Int16Array).

So can I just concatenate each buffer and save to a pcm file on the server side, when the streaming finishes? Or do I need to merge the buffers in a complex way (such as using audiobuffer-to-wav?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

There is a SO answer here which solves exactly my question. It uses the wav library to add a header, and then write the audio buffer to a file.

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