Skip to content

Commit

Permalink
Add panType property to Sound constructor and update JSDoc comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
ctoth committed Feb 5, 2024
1 parent 83a6dc8 commit 14762d4
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/cacophony.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,13 +392,14 @@ export class Sound extends FilterManager implements BaseSound {
this.context = context;
this.globalGainNode = globalGainNode;
this._position = [0, 0, 0];
this.panType = panType;
}

/**
* Creates a deep copy of the current Sound instance, including all its properties and filters.
* The cloned sound can be played and manipulated independently of the original.
* @returns {Sound} A new Sound instance that is a clone of the current sound.
*/
* Creates a deep copy of the current Sound instance, including all its properties and filters.
* The cloned sound can be played and manipulated independently of the original.
* @returns {Sound} A new Sound instance that is a clone of the current sound.
*/

clone(): Sound {
const clone = new Sound(this.url, this.buffer, this.context, this.globalGainNode, this.type);
Expand All @@ -414,10 +415,10 @@ export class Sound extends FilterManager implements BaseSound {
}

/**
* Generates a Playback instance for the sound without starting playback.
* This allows for pre-configuration of playback properties such as volume and position before the sound is actually played.
* @returns {Playback[]} An array of Playback instances that are ready to be played.
*/
* Generates a Playback instance for the sound without starting playback.
* This allows for pre-configuration of playback properties such as volume and position before the sound is actually played.
* @returns {Playback[]} An array of Playback instances that are ready to be played.
*/

preplay(): Playback[] {
let source: SourceNode;
Expand Down

0 comments on commit 14762d4

Please sign in to comment.