goldfire / howler.js

Javascript audio library for the modern web.

Home Page:https://howlerjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Expose buffer/node of Howl instances

roxteddy opened this issue · comments

Feature Proposal

Hello,

I'm working on a multi-track player and I'd like to apply effects and analyze tracks separately. It would be great to expose a node from every single Howl instances instead of Howler.mastergain

Possible Implementation

var howlTrack = new Howl(...)
var myNode = new Node(..,)

howlTrack.gain.disconnect();
howlTrack.gain.connect(myNode);
myNode.connect(Howler.masterGain);

Does it make any sense ?

In the meantime, I found this way (code in TypeScript)

this.audio = new Howl({src: url, format: 'mp3'});
this.currentNode = (this.audio as any)._sounds[0]?._node;
this.currentNode?.disconnect();
let node = Howler.ctx.createGain();
this.currentNode?.connect(node);
node.connect(Howler.masterGain);