Hi,
It seems that using a variable or constant named URL in p5.js v1.0.0 causes p5.sound.js to crash. I put an example to reproduce as follows.
https://editor.p5js.org/kotobuki/sketches/piOPquY2P
p5.sound.min.js:2 Uncaught (in promise) TypeError: URL.createObjectURL is not a function
at p5.sound.min.js:2
at Array.map ()
at p5.(p5.sound.min.js:2)
at p5.(p5.js:63250)
at Array.forEach ()
at new p5 (p5.js:63248)
at _globalInit (p5.js:62466)
I confirmed with Chrome 81.0.4044.138 on macOS 10.15.4 I can't reproduce with p5.js v0.10.12.
URL is a browser default object that is attached to the window object. It should not be used as your own variable name. Variable name is case sensitive so you can use url instead.
@kotobuki thank you for reporting this,
please follow @limzykenneth's advice :)
@limzykenneth @montoyamoraga
Thank you very much, I understood! I found this issue as a process of making an example of integrating the code snippet of Teachable Machine Pose Model and p5.js. I'll report this issue to Teachable Machine's repository.
thank you @kotobuki :) !
Most helpful comment
URLis a browser default object that is attached to thewindowobject. It should not be used as your own variable name. Variable name is case sensitive so you can useurlinstead.