goldfire / howler.js

Javascript audio library for the modern web.
https://howlerjs.com
MIT License
23.28k stars 2.21k forks source link

Audio visualizer #1686

Open Meekdai opened 8 months ago

Meekdai commented 8 months ago

Feature Proposal

I found that in the examples/player, the waveform(siriwave.js) did not follow the music. Is there a way to achieve this which shown in the link below

https://foobar404.dev/wave.js/

Possible Implementation

  1. Does howler.js have an API that can obtain the amplitude and frequency of the current music? So that I can provide it to siriwave.js.

  2. Using wave.js requires an audioElement, which I cannot get in howler.js. https://github.com/foobar404/wave.js

I have read the following links https://github.com/goldfire/howler.js/issues/771 , but there is no good solution

Violexjj commented 3 months ago

I also need to provide new apis to help me visualize the audio.

MentalGear commented 3 months ago

same problem.

Regarding Workaround 2 (wave.js), you can get the audio element with:

var node = audio._sounds[0]._node //node is an HTMLAudioElement

source: https://stackoverflow.com/a/74982310/5037146