mohayonao / audio-worker-shim

AudioWorker compatibility shim for legacy Web Audio API
26 stars 1 forks source link

how to include the "light" version of this module? #9

Open mreinstein opened 7 years ago

mreinstein commented 7 years ago

@mohayonao thanks for another great module!

I have some usage questions:

mohayonao commented 7 years ago

"full version" use audio-worker-compiler. "light version" does not use it.

audio-worker-compiler append an implicit self.

source:

onmessage = () => {};

compiled:

self.onmessage = () => {};

In light version, you must write self. yourself.

BTW, AudioWorker is deprecated in the recent Web Audio API specification. So, I think this module is useless no longer.

mreinstein commented 7 years ago

I was able to use the light version like this:

require('audio-worker-shim/light').polyfill()

// at this point you can create new audio workers as long as
// the source is compiled ahead of time with audio-worker-compiler

BTW, AudioWorker is deprecated in the recent Web Audio API specification. So, I think this module is useless no longer.

It's deprecated, intended to be placed with AudioWorklet, that's true.

But none of the browsers have implemented this yet. Until then this seems like a reasonable module to use. :)