loadSound is not defined in preload() in 1.11.11
Most appropriate sub-area of p5.js?
- [ ] Accessibility
- [ ] Color
- [ ] Core/Environment/Rendering
- [x] Data
- [ ] DOM
- [ ] Events
- [ ] Image
- [ ] IO
- [ ] Math
- [ ] Typography
- [ ] Utilities
- [ ] p5.strands
- [ ] WebGL
- [ ] DevOps, Build process, Unit testing
- [ ] Internationalization (i18n)
- [ ] Friendly Errors
- [ ] Other (specify if possible)
p5.js version
1.11.11
Web browser and version
chrome 143
Operating system
mac os 15.6.1
Steps to reproduce this
Steps:
- declare a variable
- use loadSound() in function preload() to assign
- error: loadSound is not defined
all versions prior to 1.11.11 support loadSound()
Snippet:
let beat; function preload() { beat = loadSound('sounds/worm.mp3'); }
Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms.
For guidance on contributing, check out our contributing guidelines and other resources for contributors. 💬 If you have questions or need support, feel free to join the Processing Foundation Forum or visit our Community page. 📜 Please also review our Code of Conduct to understand our community standards. Thank You!
Could not recreate the issue. Works fine on my system which is ubuntu using a cdn. Make sure if your are using cdn you include
Hi! This is an issue with the cdnjs version of p5, which is a bug with them unfortunately. Unfortunately that's the current CDN that the web editor uses for p5.sound, but see this issue for progress on that: https://github.com/processing/p5.js-web-editor/issues/3728
A secondary issue is that the default project setup (when using editor.p5js.org) calls sound lib 1.11.11 (which, as reported, doesn't allow loading sound file). If possible, until this is fixed - to revert the dev env to use 1.11.10 for projects to work. Most students don't aware of this option themselves... simple example: https://editor.p5js.org/tau1arnony/sketches/yjAKxv40j
Fixing the CDN should resolve this, I've put up a PR here: https://github.com/processing/p5.js-web-editor/pull/3758