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

168
Visualizações
Continuous audio stream to and from python server

I am a student and for a project, I want to have a webpage that sends a stream of audio continuously to a python server so that I can apply wake word detection and eventually speech recognition using python on the audio stream.

For now, I am using porcupine for the wake word on the webpage instead of the server and when the wake word is detected, media recorder is used to record 5s of audio into a blob which is sent to the server via WebSocket, which is then converted into np.array and fed into a method.

navigator.mediaDevices.getUserMedia(
{audio: {sampleRate: 16000, channelCount: 1}})
.then(stream => {
    mediaStream = stream;
}).catch(console.error);
function StartMicrophone() {
    recorder = new MediaRecorder(mediaStream);
    
    let chunks = [];
    recorder.ondataavailable = function(e) {
        chunks.push(e.data);
    }
    
    recorder.start();

    //  send the whole bytes array
    recorder.onstop = (e) => {
        const blob = new Blob(chunks, { 'type' : 'audio/wav' });
        chunks = [];
        socket.send(blob);
    }
    
    // Stop recording after 5s
    setTimeout(() => {
        recorder.stop();
    }, 5000);
}

Would there be a way to send continuous streams of data (blob) to the server and then back to the webpage.

Thank you for any input possible.

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