Possible to analyze streaming audio from Icecast using Web Audio API and createMediaElementSource?

后端 未结 2 1271
忘掉有多难
忘掉有多难 2021-02-04 15:18

Using the Web Audio API and createMediaElement method you can use a typed array to get frequency data from audio playback in an element and it works i

相关标签:
2条回答
  • 2021-02-04 15:43

    It just is not implemented according to the specs in Safari and will return an array of zeroes instead of frequencies for streams. Many people have observed this behaviour, e.g. http://isflashdeadyet.com/tests/web-audio-visualization/index-analyser.html and https://github.com/Okazari/Rythm.js/issues/7

    It is supposted to work according to https://browsersupport.io/AnalyserNode.prototype.getByteFrequencyData

    Here you will find that "Safari [is] seemingly reporting no signal (a value of 128) across the board when requesting byte data on an AnalyserNode": http://fourthof5.com/audio-visualisation-with-the-web-audio-api

    Test the demo here to see the current status: http://fourthof5.com/assets/posts/audio-visualisation-with-the-web-audio-api/index.html

    0 讨论(0)
  • 2021-02-04 15:59

    Still not working with Safari and iOS Chrome (which is using Apple WebKit?). Other browsers seem to be fine now. Audio plays fine, CORS is ok - yet Analyser is not working.

    This fiddle (not mine) demonstrates the behavior well. Latter uri gets analysed, former not:

      const url = useStream
      ? 'https://c2.radioboss.fm:18071/stream'
      : 'https://twgljs.org/examples/sounds/DOCTOR%20VOX%20-%20Level%20Up.mp3';
    

    Related question in Apple forum (no answers)

    0 讨论(0)
提交回复
热议问题