Skip to content

Commit

Permalink
better type and JS docs, see #161
Browse files Browse the repository at this point in the history
  • Loading branch information
jbphet committed May 18, 2022
1 parent 3021b2f commit ddc4867
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 5 deletions.
1 change: 0 additions & 1 deletion js/SoundUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ const findSoundStartIndex = ( soundData: Float32Array, length: number, threshold
* @param soundData - the sample values for the sound
* @param length - length of the sound data
* @param threshold - detection level for the presence of sound, should be between 0 and 1
* @returns {number} - index where sound ends
*/
const findSoundEndIndex = ( soundData: Float32Array, length: number, threshold: number ): number => {

Expand Down
2 changes: 1 addition & 1 deletion js/sound-generators/NoiseGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ class NoiseGenerator extends SoundGenerator {

/**
* Stop the noise source.
* @param {number} [time] - optional audio context time at which this should be stopped
* @param [time] - optional audio context time at which this should be stopped
*/
public stop( time = 0 ): void {

Expand Down
2 changes: 0 additions & 2 deletions js/sound-generators/PitchedPopGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,12 @@ class PitchedPopGenerator extends SoundGenerator {
this.soundSources = [];
_.times( options.numPopGenerators, () => {

// {OscillatorNode}
const oscillator = this.audioContext.createOscillator();
const now = this.audioContext.currentTime;
oscillator.type = 'sine';
oscillator.frequency.setValueAtTime( options.pitchRange.min, now );
oscillator.start( 0 );

// {GainNode}
const gainNode = this.audioContext.createGain();
gainNode.gain.setValueAtTime( 0, now );
oscillator.connect( gainNode );
Expand Down
1 change: 0 additions & 1 deletion js/sound-generators/SoundClip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ class SoundClip extends SoundGenerator {

/**
* ES5 getter for playback rate
* @returns {number}
*/
public get playbackRate(): number {
return this.getPlaybackRate();
Expand Down

0 comments on commit ddc4867

Please sign in to comment.