Integrate Processing with Minim Libraries in Website

爱⌒轻易说出口 提交于 2019-12-06 04:13:05
Kevin Workman

Think about it this way:

  • "Core Processing" contains all of the variables and functions you can use in a plain old Processing sketch.
  • You can deploy "core Processing" as a Java application. If you do so, you can also use Java libraries, like minim.
  • You can also deploy "core Processing" as JavaScript using Processing.js. If you do so, you can embed your sketch into a webpage and use JavaScript syntax to access the html components of that surrounding webpage.
  • But you can't mix them: you can't embed a Java application in a webpage (applets are dead), and you can't use Java libraries in a JavaScript webpage.

Minim is a Java library, so you can't use it directly in a JavaScript application. Instead, you have to find a JavaScript library that does something similar. You've posted one method (what do you mean when you say it didn't work?), but googling "processing.js audio" or "minim javascript" returns a bunch of others, including this related question:

Exporting a Processing sketch with audio to JavaScript

Also, you should get acquainted with the JavaScript console. In your web browser, press F12, then go to the console tab, then refresh your page. That will show you any errors you're hitting, that way you have more information than "it's a blank rectangle".

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