danigb / soundfont-player

Quick soundfont loader and player for browser
MIT License
455 stars 59 forks source link

Loading soundfont with Angular #75

Open tjvg91 opened 4 years ago

tjvg91 commented 4 years ago

I tried getting soundfont using Angular. I get this error:

Argument of type 'AudioContext' is not assignable to parameter of type '{ new (contextOptions?: AudioContextOptions): AudioContext; prototype: AudioContext; }'.
  Property 'prototype' is missing in type 'AudioContext' but required in type '{ new (contextOptions?: AudioContextOptions): AudioContext; prototype: AudioContext; }'.

This is my code:

const newPlayer = SoundFont.instrument(new AudioContext(), 'assets/soundfonts/acoustic_grand_piano-mp3.js');

error is in new AudioContext() part