chrisguttandin / standardized-audio-context

A cross-browser wrapper for the Web Audio API which aims to closely follow the standard.
MIT License
679 stars 33 forks source link

Error when using with SoundfontPlayer and Angular 11.2 #978

Closed conde2 closed 3 years ago

conde2 commented 3 years ago

Running in Angular 11.2

image

Using standardized-audio-context with SoundfontPlayer throws me this error. https://github.com/danigb/soundfont-player

UPDATE 1: Update the image with a better traceback.

chrisguttandin commented 3 years ago

Hi @conde2, can you please provide some sample code which causes the issue? Without being able to reproduce it I have no idea what is causing the issue. Also standardized-audio-context is not mentioned in the stack trace at all. Are you sure the issue is caused by standardized-audio-context?

conde2 commented 3 years ago

I manage to get a better traceback.

Here is the repository with minimum reproduction code.

just run

npm install
ng serve

https://github.com/conde2/audio-context-bug

Here is the code that causes the error:

https://github.com/conde2/audio-context-bug/commit/59f748c47fe3e916f36ae7d4fdcfa15ecbcab59e#diff-cc2eb36e42d085f18a5d23d33264541fe34aaa5d7203ebfd6af8e1e6eef5d269

OBS: If I use the regular AudioContext I don't have any error.

The error should appear in the conosle http://localhost:4200/tabs/tab1

image

chrisguttandin commented 3 years ago

Thanks a lot for the detailed report and for the repo to reproduce the error. That made it very easy for me to track down the problem.

Although I do not really understand why my changes make any difference the error seems to be catched correctly now. As a side effect the code is also a bit more elegant now. :-)

Thanks again for reporting this.

chrisguttandin commented 3 years ago

v25.2.3 contains the fix.

conde2 commented 3 years ago

Thanks! The changes fixed the error.

Maybe the error was something related how Typescript transpile the code to javascript... Well problem solved anyway =)