Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

170
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda