Skip to content

Commit 080cd97

Browse files
authored
p5.sound preload->async/await
1 parent 556229b commit 080cd97

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/addons/p5.sound.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2945,11 +2945,10 @@ function () {
29452945
}();
29462946
/**
29472947
* loadSound() returns a new p5.SoundFile from a specified
2948-
* path. If called during preload(), the p5.SoundFile will be ready
2949-
* to play in time for setup() and draw(). If called outside of
2950-
* preload, the p5.SoundFile will not be ready immediately, so
2951-
* loadSound accepts a callback as the second parameter. Using a
2952-
* <a href="https://github.com/processing/p5.js/wiki/Local-server">
2948+
* path. If used with asynchronous setup (via `async`/`await`), the p5.SoundFile
2949+
* will be ready to play in time for `setup()` and `draw()`. If called outside of an async context,
2950+
* the p5.SoundFile will not be ready immediately, so loadSound accepts a callback as the second
2951+
* parameter. Using a <a href="https://github.com/processing/p5.js/wiki/Local-server">
29532952
* local server</a> is recommended when loading external files.
29542953
*
29552954
* @method loadSound

0 commit comments

Comments
 (0)