AudioScience HPI  Version_4.33.01
Functions
Tone Detector control

The tone detector monitors its inputs for the presence of any of a number of tones. More...

Functions

hpi_err_t HPI_ToneDetector_GetFrequency (const hpi_hsubsys_t *phSubSys, hpi_handle_t hControl, uint32_t nIndex, uint32_t *dwFrequency)
 Enumerate the detection frequencies of the tone detector control. More...
 
hpi_err_t HPI_ToneDetector_GetState (const hpi_hsubsys_t *phSubSys, hpi_handle_t hControl, uint32_t *state)
 Get tone detector state. More...
 
hpi_err_t HPI_ToneDetector_SetEnable (const hpi_hsubsys_t *phSubSys, hpi_handle_t hControl, uint32_t enable)
 Enable (or disable) a ToneDetector control. More...
 
hpi_err_t HPI_ToneDetector_GetEnable (const hpi_hsubsys_t *phSubSys, hpi_handle_t hControl, uint32_t *enable)
 Get the Enable state of a ToneDetector control. More...
 
hpi_err_t HPI_ToneDetector_SetEventEnable (const hpi_hsubsys_t *phSubSys, hpi_handle_t hControl, uint32_t EventEnable)
 Enable ToneDetector control event generation. More...
 
hpi_err_t HPI_ToneDetector_GetEventEnable (const hpi_hsubsys_t *phSubSys, hpi_handle_t hControl, uint32_t *EventEnable)
 Get the event generation enable state of a ToneDetector control. More...
 
hpi_err_t HPI_ToneDetector_SetThreshold (const hpi_hsubsys_t *phSubSys, hpi_handle_t hControl, int threshold)
 Set the Threshold of a ToneDetector control. More...
 
hpi_err_t HPI_ToneDetector_GetThreshold (const hpi_hsubsys_t *phSubSys, hpi_handle_t hControl, int *threshold)
 Get the Threshold of a ToneDetector control. More...
 

Detailed Description

The tone detector monitors its inputs for the presence of any of a number of tones.

Currently 25Hz and 35Hz tones can be detected independently on left and right channels. Tones that exceed the threshold set by HPI_ToneDetector_SetThreshold() are detected. The result of the detection is reflected in the controls state, and optionally by sending an async event with the new state.

Function Documentation

◆ HPI_ToneDetector_GetFrequency()

hpi_err_t HPI_ToneDetector_GetFrequency ( const hpi_hsubsys_t *  phSubSys,
hpi_handle_t  hControl,
uint32_t  nIndex,
uint32_t *  dwFrequency 
)

Enumerate the detection frequencies of the tone detector control.

Parameters
phSubSysVestigial subsys handle (unused), may be set to NULL
hControlHandle to tone detector control.
nIndexiterate this from zero to get detector frequencies in *dwFreqency
*dwFrequencydetection frequency of tone detector band number nIndex
Returns
0 on success, or one of the HPI_ERROR_CODES.
Return values
HPI_ERROR_INVALID_CONTROL_VALUEif nIndex >= number of frequencies supported

◆ HPI_ToneDetector_GetState()

hpi_err_t HPI_ToneDetector_GetState ( const hpi_hsubsys_t *  phSubSys,
hpi_handle_t  hControl,
uint32_t *  state 
)

Get tone detector state.

Parameters
phSubSysVestigial subsys handle (unused), may be set to NULL
hControlHandle to tone detector control.
*stateTonedetector state reflected in the bits of *State. Upper 16 bits is right channel, lower 16 bits is left channel. LSB represents lowest frequency detector (25Hz)
Returns
0 on success, or one of the HPI_ERROR_CODES.

◆ HPI_ToneDetector_SetEnable()

hpi_err_t HPI_ToneDetector_SetEnable ( const hpi_hsubsys_t *  phSubSys,
hpi_handle_t  hControl,
uint32_t  enable 
)

Enable (or disable) a ToneDetector control.

Parameters
phSubSysVestigial subsys handle (unused), may be set to NULL
hControlHandle to tone detector control.
enable1=enable, 0=disable

◆ HPI_ToneDetector_GetEnable()

hpi_err_t HPI_ToneDetector_GetEnable ( const hpi_hsubsys_t *  phSubSys,
hpi_handle_t  hControl,
uint32_t *  enable 
)

Get the Enable state of a ToneDetector control.

Parameters
phSubSysVestigial subsys handle (unused), may be set to NULL
hControlHandle to tone detector control.
*enable1=enable, 0=disable

◆ HPI_ToneDetector_SetEventEnable()

hpi_err_t HPI_ToneDetector_SetEventEnable ( const hpi_hsubsys_t *  phSubSys,
hpi_handle_t  hControl,
uint32_t  EventEnable 
)

Enable ToneDetector control event generation.

Parameters
phSubSysVestigial subsys handle (unused), may be set to NULL
hControlHandle to tone detector control.
EventEnable1=enable, 0=disable

◆ HPI_ToneDetector_GetEventEnable()

hpi_err_t HPI_ToneDetector_GetEventEnable ( const hpi_hsubsys_t *  phSubSys,
hpi_handle_t  hControl,
uint32_t *  EventEnable 
)

Get the event generation enable state of a ToneDetector control.

Parameters
phSubSysVestigial subsys handle (unused), may be set to NULL
hControlHandle to tone detector control.
EventEnable1=enable, 0=disable

◆ HPI_ToneDetector_SetThreshold()

hpi_err_t HPI_ToneDetector_SetThreshold ( const hpi_hsubsys_t *  phSubSys,
hpi_handle_t  hControl,
int  threshold 
)

Set the Threshold of a ToneDetector control.

Parameters
phSubSysVestigial subsys handle (unused), may be set to NULL
hControlHandle to tone detector control.
thresholdin millibels wrt full scale. E.g. -2000 -> -20dBFS threshold. Tones with level above this threshold are detected.
Returns
0 on success, or one of the HPI_ERROR_CODES.

◆ HPI_ToneDetector_GetThreshold()

hpi_err_t HPI_ToneDetector_GetThreshold ( const hpi_hsubsys_t *  phSubSys,
hpi_handle_t  hControl,
int *  threshold 
)

Get the Threshold of a ToneDetector control.

Parameters
phSubSysVestigial subsys handle (unused), may be set to NULL
hControlHandle to tone detector control.
*thresholdcurrent threshold,
See also
HPI_ToneDetector_SetThreshold()