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

241
Visualizações
Can I use createMediaElementSource() without a DOM element?

I am streaming PCM audio chunks by emitting them via socket.io. Then on the browser am using pcm-player to feed the the data as they are received.

I can hear the sound clearly, and everything seems fine. My issue is now that I want to visualize the sound that I am receiving, but everywhere I looked, I stumble on the same part. I need to create a AudioContext analyzer, which needs a source. The only way I can create a source, is by linking it to an <audio> tag createMediaElementSource()

My question is: How can I connect the AudioContext analyzer to the PCMPlayer source? This is what the PCMPlayer contains: enter image description here

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

0

Looks like the gainNode is what PCM Player uses as the final AudioNode in its internal graph.

https://github.com/samirkumardas/pcm-player/blob/ab0c17a2ec75c99abe853eacf47a0113651a7636/pcm-player.js#L50-L52

You can just use that as an input for your visualization. But if you want to do so you need to re-use the AudioContext used by PCM Player. It's not possible to connect an AudioNode created on one AudioContext to another AudioContext.

The following should work:

const analyserNode = AnalyserNode(pcmPlayer.audioCtx);

pcmPlayer.gainNode.connect(analyserNode);
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