diff --git a/Tone/source/buffer/Players.ts b/Tone/source/buffer/Players.ts index ddfc71c4..4a5ac9ca 100644 --- a/Tone/source/buffer/Players.ts +++ b/Tone/source/buffer/Players.ts @@ -202,6 +202,12 @@ export class Players extends ToneAudioNode { * @param name A unique name to give the player * @param url Either the url of the bufer or a buffer which will be added with the given name. * @param callback The callback to invoke when the url is loaded. + * @example + * const players = new Tone.Players(); + * players.add("gong", "https://tonejs.github.io/audio/berklee/gong_1.mp3", () => { + * console.log("gong loaded"); + * players.get("gong").start(); + * }); */ add(name: string, url: string | ToneAudioBuffer | AudioBuffer, callback?: () => void): this { assert(!this._buffers.has(name), "A buffer with that name already exists on this object");