processing / p5.sound.js-ARCHIVE

new build of p5.sound.js library
GNU Lesser General Public License v2.1
33 stars 6 forks source link

fix audioWorklet issues, current build not working with just Grunt #129

Open montoyamoraga opened 7 months ago

ogbabydiesal commented 5 months ago

after uncommenting the audioworklet imports and audioin prototype in the src/app.js file and building I get an error about "preval" not being defined at the audioWorklet/soundFileProcessor.js

could it be that preval is not being configured in the build configuration?

Image

the old p5 sound library had this babel configuration file that is not in the new library https://github.com/processing/p5.js-sound/blob/main/.babelrc

@montoyamoraga @Qianqianye @raclim

not sure why i can't tag @limzkenneth !

Qianqianye commented 5 months ago

Thanks @tmartinez88. I just updated the permission, we can tag @limzykenneth now!

montoyamoraga commented 5 months ago

hi @tmartinez88 yeah, that's something i heavily struggled with, as far as i know, that preval was being done with the webpack build of the original library p5.sound.js, but now in this new one i followed the grunt build of p5.js, and with that i couldn't figure out how to make those audioworklets build correctly, here happy to help!

limzykenneth commented 5 months ago

@tmartinez88 preval is a Babel plugin that essentially do compile time execution and evaluation (in this case of the contents of the require statement).

Looking at the code for audioWorklet, I'm not entirely sure they are required since they are essentially importing values from another file and not really relying on the evaluation. Perhaps they can be replace directly with regular import statements?