ASPiK SDK
Loading...
Searching...
No Matches
AudioDetector Class Reference

The AudioDetector object implements the audio detector defined in the book source below. NOTE: this detector can receive signals and transmit detection values that are both > 0dBFS. More...

#include <fxobjects.h>

Inheritance diagram for AudioDetector:
IAudioSignalProcessor

Public Member Functions

virtual bool reset (double _sampleRate)
 
virtual bool canProcessAudioFrame ()
 
virtual double processAudioSample (double xn)
 
AudioDetectorParameters getParameters ()
 
void setParameters (const AudioDetectorParameters &parameters)
 
virtual void setSampleRate (double _sampleRate)
 
- Public Member Functions inherited from IAudioSignalProcessor
virtual bool reset (double _sampleRate)=0
 
virtual double processAudioSample (double xn)=0
 
virtual bool canProcessAudioFrame ()=0
 
virtual void setSampleRate (double _sampleRate)
 
virtual void enableAuxInput (bool enableAuxInput)
 
virtual double processAuxInputAudioSample (double xn)
 
virtual bool processAudioFrame (const float *inputFrame, float *outputFrame, uint32_t inputChannels, uint32_t outputChannels)
 

Protected Member Functions

void setAttackTime (double attack_in_ms, bool forceCalc=false)
 sets the new attack time and re-calculates the time constant
 
void setReleaseTime (double release_in_ms, bool forceCalc=false)
 sets the new release time and re-calculates the time constant
 

Protected Attributes

AudioDetectorParameters audioDetectorParameters
 parameters for object
 
double attackTime = 0.0
 attack time coefficient
 
double releaseTime = 0.0
 release time coefficient
 
double sampleRate = 44100
 stored sample rate
 
double lastEnvelope = 0.0
 output register
 

Detailed Description

The AudioDetector object implements the audio detector defined in the book source below. NOTE: this detector can receive signals and transmit detection values that are both > 0dBFS.

Audio I/O:

  • Processes mono input to a detected signal output.

Control I/F:

Author
Will Pirkle http://www.willpirkle.com
Remarks
This object is included in Designing Audio Effects Plugins in C++ 2nd Ed. by Will Pirkle
Version
Revision : 1.0
Date
Date : 2018 / 09 / 7

Member Function Documentation

◆ canProcessAudioFrame()

virtual bool AudioDetector::canProcessAudioFrame ( )
inlinevirtual

return false: this object only processes samples

Implements IAudioSignalProcessor.

◆ getParameters()

AudioDetectorParameters AudioDetector::getParameters ( )
inline

get parameters: note use of custom structure for passing param data

Returns
AudioDetectorParameters custom data structure

◆ processAudioSample()

virtual double AudioDetector::processAudioSample ( double  xn)
inlinevirtual
Parameters
xninput
Returns
the processed sample

Implements IAudioSignalProcessor.

◆ reset()

virtual bool AudioDetector::reset ( double  _sampleRate)
inlinevirtual

set sample rate dependent time constants and clear last envelope output value

Implements IAudioSignalProcessor.

◆ setAttackTime()

void AudioDetector::setAttackTime ( double  attack_in_ms,
bool  forceCalc = false 
)
protected

sets the new attack time and re-calculates the time constant

set our internal atack time coefficients based on times and sample rate

Parameters
attack_in_msthe new attack timme
forceCalcflag to force a re-calculation of time constant even if values have not changed.

◆ setParameters()

void AudioDetector::setParameters ( const AudioDetectorParameters parameters)
inline

set parameters: note use of custom structure for passing param data

Parameters
AudioDetectorParameterscustom data structure

◆ setReleaseTime()

void AudioDetector::setReleaseTime ( double  release_in_ms,
bool  forceCalc = false 
)
protected

sets the new release time and re-calculates the time constant

set our internal release time coefficients based on times and sample rate

Parameters
release_in_msthe new relase timme
forceCalcflag to force a re-calculation of time constant even if values have not changed.

◆ setSampleRate()

virtual void AudioDetector::setSampleRate ( double  _sampleRate)
inlinevirtual

set sample rate - our time constants depend on it

Reimplemented from IAudioSignalProcessor.


The documentation for this class was generated from the following files: