Open
Description
Most appropriate sub-area of p5.js?
- Accessibility
- Color
- Core/Environment/Rendering
- Data
- DOM
- Events
- Image
- IO
- Math
- Typography
- Utilities
- WebGL
- Build process
- Unit testing
- Internationalization
- Friendly errors
- Other (specify if possible)
p5.js version
2.0.3
Web browser and version
Chrome 137.0.7151.57
Operating system
Windows
Steps to reproduce this
Steps:
- Opened project with sound that works in 1.x
- Changed version to 2.0.3
- Moved loadSound to function set up and changed function set up to async function set up.
- Added await before the loadSound function.
- Console reports TypeError: Cannot read properties of undefined (reading 'pixels') && ReferenceError: loadSound is not defined
at setup (/sketch.js:9:3)
Snippet:
sketch.js
// Paste your code here :)
let note1, note2, note3, note4, note5, note6
async function setup() {
createCanvas(600, 400);
rectMode(CENTER)
soundFormats('mp3', 'ogg');
note1 = await loadSound('c.mp3')
note2 = await loadSound('d.mp3')
note3 = await loadSound('e.mp3')
note4 = await loadSound('f.mp3')
note5 = await loadSound('g.mp3')
note6 = await loadSound('a.mp3')
}
Metadata
Metadata
Assignees
Type
Projects
Status
Bug/Investigation