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

131
Visualizações
javascript Audio visualisation in Safari not working for internet radio streams (Icecast/shoutcast)

Can anybody help me to check why this code is not working in Safari (osx)? The audio is is playing, but no visualisation. I tried all the hints I found, but still no luck. Need to mention it's working fine in Chrome (osx) Thanks a lot for help

function getDataFromAudio() {
  var freqByteData = new Uint8Array(analyser.fftSize / 2);
  var timeByteData = new Uint8Array(analyser.fftSize / 2);
  analyser.getByteFrequencyData(freqByteData);
  analyser.getByteTimeDomainData(timeByteData);
  return { f: freqByteData, t: timeByteData }; // array of all 1024 levels
}

Codepen

To be more precise, the visualisation and getByteFrequencyData/getByteTimeDomainData does not work for internet radios (Icecast/shoutcast), but works for single remote mp3.

  1. CodePen - audio stream test icecast - not working in Safari
  2. CodePen - audio stream test mp3 - working in Safari
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I think this is actually a bug in Safari.

The analyzer data is all zeroes, which is typical if there's a CORS problem. Yet, I don't see any issue with the response headers from that Icecast stream. Access-Control-Allow-Origin is set to * which is the same as the GitHub.io stream.

The only two meaningful differences in the responses that I see:

  • The MP3 file has the erroneous Content-Type of audio/mp3. (It should be audio/mpeg.)
  • Safari requests ICY-style metadata from the stream.

I suspect Safari is handing the stream off to some other component, and its output cannot be captured with the MediaElementSourceNode.

Though, hopefully I'm wrong, and folks can show a real solution and downvote this answer. :-)

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