Skip to content

Commit

Permalink
converted JS to TS, see #160
Browse files Browse the repository at this point in the history
  • Loading branch information
jbphet committed Apr 6, 2022
1 parent 56af293 commit e0641ea
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions js/PeakDetectorAudioNode.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// Copyright 2021, University of Colorado Boulder

// @ts-nocheck

/**
* PeakDetectorAudioNode is a Web Audio node that can be used to detect peak audio output values in an audio signal
* chain. The detected peak audio values are output to the console. This file contains the portion that runs in the
Expand All @@ -28,20 +26,20 @@ import merge from '../../phet-core/js/merge.js';
import phetAudioContext from './phetAudioContext.js';
import tambo from './tambo.js';

class PeakDetectorAudioNode extends AudioWorkletNode {
export type PeakDetectorAudioNodeOptions = {

/**
* @param {Object} [options]
*/
constructor( options ) {
// If true, zero values will be output, otherwise no output will occur if the peak value detected for a given time
// interval is zero.
logZeroValues?: boolean;
};

options = merge( {
class PeakDetectorAudioNode extends AudioWorkletNode {

// {boolean} - If true, zero values will be output, otherwise no output will occur if the peak value detected
// for a given time interval is zero.
logZeroValues: false
constructor( providedOptions: PeakDetectorAudioNodeOptions ) {

}, options );
const options = merge( {
logZeroValues: false
}, providedOptions );

super( phetAudioContext, 'peak-detector' );

Expand Down

0 comments on commit e0641ea

Please sign in to comment.