howler-plugin-effect-chain
howler-plugin-effect-chain copied to clipboard
Property 'addEffect' does not exist on type 'HowlerGlobal'
I am getting this error in a Typescript project. (howler v2.0.15)
Property 'addEffect' does not exist on type 'HowlerGlobal'
my code is as follows:
import { Howl, Howler } from 'howler';
import 'howler-plugin-effect-chain';
import Tuna from 'tunajs';
const tuna = new Tuna(Howler.ctx);
const chorus = new tuna.Chorus({});
Howler.addEffect(chorus);
Hi @koraysels. The example is missing an instantiation of a Howl
object. This is due to the internals of howler
: it is only fully initialised after creating a Howl
.
import { Howl, Howler } from 'howler';
import 'howler-plugin-effect-chain';
import Tuna from 'tunajs';
const sound = new Howl({ src: 'somefile.mp3' });
const tuna = new Tuna(Howler.ctx);
const chorus = new tuna.Chorus({});
Howler.addEffect(chorus);
Adding line 5 there should fix the issue. Let me know if it works, and I'll update the README.