diff --git a/js/PeakDetectorAudioNode.ts b/js/PeakDetectorAudioNode.ts index 4e508796..fb378da1 100644 --- a/js/PeakDetectorAudioNode.ts +++ b/js/PeakDetectorAudioNode.ts @@ -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 @@ -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' );