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

160
Visualizações
Tone.js audio filters not being heard

I'm trying to add filter effects to an audio stream I have playing on my website. I'm able to connect the Tone.js library to the audio stream but I'm not hearing any changes in the audio stream playing on the website. I'm not seeing any errors in the console and I've tried adjusting the filter from 50 to 5000 but nothing seems to have any effect on the audio. Do I need to set up the new Tone.Player() to actually hear the audio? If so, how do you go about setting up the Player if there is no src for the existing audio element.

    $('#testBtn').click(async function () {
        const audioElement = document.getElementById('theAudioStream');
        const mediaElementSource = Tone.context.createMediaElementSource(audioElement);
        const filter = new Tone.Filter(50, 'lowpass').toDestination();
        Tone.connect(mediaElementSource, filter);
        await Tone.start();
        console.log("Started?");
    });

The audio stream I'm trying to modify is set up from a JsSip call. The code to start the stream is as follows:


    var audioStream = document.getElementById('theAudioStream')

    //further down in code    

    currentSession.answer(options);
    if (currentSession.connection) {
        currentSession.connection.ontrack = function (e) {
          audioStream.srcObject = e.streams[0];
          audioStream.play();
        }
    }

I click the test button after the call has started so I know the audio stream is present before initializing the Tone.js Filters

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

0

Working solution:
Removing the audioStream.play() from where the JsSIP call is answered solves the issue.
I don't know the exact reason why this solves the issue (it might even be a workaround) but after much trial and error this way allows the audio to be available to ToneJS for effecting.

Any other solutions are welcome.

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