hvianna / audioMotion-analyzer

High-resolution real-time graphic audio spectrum analyzer JavaScript module with no dependencies.
https://audioMotion.dev
GNU Affero General Public License v3.0
619 stars 62 forks source link

[Question] Is there a way to connect multiple audio elements to a visualizer, or maybe the final AudioDestinationNode? #46

Closed adityakrshnn closed 1 year ago

adityakrshnn commented 1 year ago

Hi,

Great Project I must say! I wanted to ask if we can connect multiple audio elements to the visualizer, or maybe the final AudioDestinationNode of the speaker? I want the visualier to be a sum of all the media (including videos) running on the website.

Thanks

adityakrshnn commented 1 year ago

I found a way to do it. You can use a GainNode to connect multiple audio sources to it and then attach it to audioMotion https://codepen.io/adityakrshnn/pen/abRPXvw

hvianna commented 1 year ago

You can connect additional sources after instantiation with connectInput()