Exporting a Processing sketch with audio to JavaScript

狂风中的少年 提交于 2019-11-29 08:56:57

For minim, you can use a relatively simple shim such as https://github.com/Pomax/Pjs-2D-Game-Engine/blob/master/minim.js - include it as a normal JS script on your page before loading any sketches, and your sketch won't complain that minim is an unknown thing.

Because Processing.js compiles your sketch to native JavaScript, global objects like Minim can simply be emulated in JavasScript as well: as long as the functions you're calling for Minim are defined in your JS "shim", things should work just fine.

On a more general note, because Processing libraries are precompiled Java VM byte code, Processing.js cannot load them, so any import statement is ignored.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!