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

101
Visualizações
Send mixed audio through webrtc using mediasoup

What I want to do is to receive sound from one mediasoup server. Mix it and then send it to another server. This seemed like a simple task, but for a couple days I have been struggling with it.

How I do it? I put audio I receive in <audio> tags And here is my code

      let audioContext = new (window.AudioContext || window.webkitAudioContext)();

      const audioElement = document.getElementById(this.consumer.id)
      const incomingSource = audioContext.createMediaElementSource(audioElement);

      this.filter = audioContext.createBiquadFilter();
      this.filter.type = "lowpass";
      this.filter.frequency.value = 1000;

      const outgoingStream = new MediaStreamAudioDestinationNode(audioContext);
      incomingSource.connect(this.filter);
      this.filter.connect(outgoingStream);
      this.outgoingTrack = outgoingStream.stream.getAudioTracks()[0];

And then I am sending this via mediasoup by using this.sendTransport.produce({track: this.outgoingTrack})

What I think I am doing is getting the sound I received then connecting the filter to this sound, then connecting the filter to the stream I want to forward and finally sending the track.

But that doesn't work so apparently I am doing something wrong. When I am doing this without filter like this:

      let audioContext = new (window.AudioContext || window.webkitAudioContext)();

      const audioElement = document.getElementById(this.consumer.id)
      const incomingSource = audioContext.createMediaElementSource(audioElement);

      const srcObject = incomingSource.mediaElement.srcObject;
      const outgoingTrack1 = srcObject.getAudioTracks()[0]

It works flawlessly but it is only forwarding the sound without any changes to it.

So how can I mix this sound?

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