AudioScience HPI Version_4.24.1
Defines | Functions

Meter Control

Controls

The meter control returns information about the level of the audio signal at the position of the control. More...

Defines

#define HPI_METER_MINIMUM   (-150 * HPI_UNITS_PER_dB)
 value returned for no signal

Functions

hpi_err_t HPI_Meter_QueryChannels (const hpi_hsubsys_t *phSubSys, const hpi_handle_t hMeter, uint32_t *pChannels)
 Get the number of channels supported by this meter.
hpi_err_t HPI_MeterGetPeak (const hpi_hsubsys_t *phSubSys, hpi_handle_t hControl, short anPeakdB[HPI_MAX_CHANNELS])
 Get the meter peak reading.
hpi_err_t HPI_MeterGetRms (const hpi_hsubsys_t *phSubSys, hpi_handle_t hControl, short anRmsdB[HPI_MAX_CHANNELS])
 Get the meter RMS reading in 100ths of a dB.
hpi_err_t HPI_MeterSetRmsBallistics (const hpi_hsubsys_t *phSubSys, hpi_handle_t hControl, uint16_t nAttack, uint16_t nDecay)
 Set the ballistics of the RMS part of a meter.
hpi_err_t HPI_MeterGetRmsBallistics (const hpi_hsubsys_t *phSubSys, hpi_handle_t hControl, uint16_t *pnAttack, uint16_t *pnDecay)
 Get the ballistics settings of the RMS part of a meter.
hpi_err_t HPI_MeterSetPeakBallistics (const hpi_hsubsys_t *phSubSys, hpi_handle_t hControl, uint16_t nAttack, uint16_t nDecay)
 Set the ballistics of the Peak part of a meter.
hpi_err_t HPI_MeterGetPeakBallistics (const hpi_hsubsys_t *phSubSys, hpi_handle_t hControl, uint16_t *pnAttack, uint16_t *pnDecay)
 Get the ballistics settings of the Peak part of a meter.

Detailed Description

The meter control returns information about the level of the audio signal at the position of the control.

Depending on the adapter, Peak and RMS readings are available. On some adapters meter ballistics may be set (on older adapters the meter gives an instantaneous reading)

Readings are in units of 0.01dB


Define Documentation

#define HPI_METER_MINIMUM   (-150 * HPI_UNITS_PER_dB)

value returned for no signal

Referenced by HPI_MeterGetPeak(), and HPI_MeterGetRms().


Function Documentation

hpi_err_t HPI_Meter_QueryChannels ( const hpi_hsubsys_t *  phSubSys,
const hpi_handle_t  hMeter,
uint32_t *  pChannels 
)

Get the number of channels supported by this meter.

Parameters:
phSubSysVestigial subsys handle (unused), may be set to NULL
hMeterControl to query
pChannelsnumber of channels

References HPI_ControlQuery().

hpi_err_t HPI_MeterGetPeak ( const hpi_hsubsys_t *  phSubSys,
hpi_handle_t  hControl,
short  anPeakdB[HPI_MAX_CHANNELS] 
)

Get the meter peak reading.

Returns:
0 on success, or one of the HPI_ERROR_CODES.

Parameters:
phSubSysVestigial subsys handle (unused), may be set to NULL
hControlmeter control handle
anPeakdBmeter peaks in millibels

References HPI_METER_MINIMUM.

hpi_err_t HPI_MeterGetRms ( const hpi_hsubsys_t *  phSubSys,
hpi_handle_t  hControl,
short  anRmsdB[HPI_MAX_CHANNELS] 
)

Get the meter RMS reading in 100ths of a dB.

Returns:
0 on success, or one of the HPI_ERROR_CODES.

Parameters:
phSubSysVestigial subsys handle (unused), may be set to NULL
hControlmeter control handle
anRmsdBmeter RMS values in millibels

References HPI_METER_MINIMUM.

hpi_err_t HPI_MeterSetRmsBallistics ( const hpi_hsubsys_t *  phSubSys,
hpi_handle_t  hControl,
uint16_t  nAttack,
uint16_t  nDecay 
)

Set the ballistics of the RMS part of a meter.

The attack and decay values represent the time constants of the equivalent single pole low pass filter used to create the ballistics. With a time constant of T, if the meter is stable at full scale and the input is suddenly removed, the meter will decay.

Setting nAttack to 0 gives the meter instantaneous rise time. Setting nDecay to a value smaller than a few times your meter polling interval is not advised. The meter will appear to read something approaching the instantaneous value at the time of polling rather than the maximum peak since the previous reading.

Driver versions up to and including version 4.04.xx implement a single global ballistics setting for all meters, i.e. if you change the ballistics on one meter, the ballistics on all meters are updated. Driver versions in the 4.05.xx series and later implement independent ballistics for each meter.

Returns:
0 on success, or one of the HPI_ERROR_CODES.
Parameters:
phSubSysVestigial subsys handle (unused), may be set to NULL
hControlHandle to control of type HPI_CONTROL_METER
nAttackAttack timeconstant in milliseconds
nDecayDecay timeconstant in milliseconds
hpi_err_t HPI_MeterGetRmsBallistics ( const hpi_hsubsys_t *  phSubSys,
hpi_handle_t  hControl,
uint16_t *  pnAttack,
uint16_t *  pnDecay 
)

Get the ballistics settings of the RMS part of a meter.

Returns:
0 on success, or one of the HPI_ERROR_CODES.
Parameters:
phSubSysVestigial subsys handle (unused), may be set to NULL
hControlHandle to control of type HPI_CONTROL_METER
pnAttackAttack timeconstant in milliseconds
pnDecayDecay timeconstant in milliseconds
hpi_err_t HPI_MeterSetPeakBallistics ( const hpi_hsubsys_t *  phSubSys,
hpi_handle_t  hControl,
uint16_t  nAttack,
uint16_t  nDecay 
)

Set the ballistics of the Peak part of a meter.

Returns:
0 on success, or one of the HPI_ERROR_CODES.
Parameters:
phSubSysVestigial subsys handle (unused), may be set to NULL
hControlHandle to control of type HPI_CONTROL_METER
nAttackAttack timeconstant in milliseconds
nDecayDecay timeconstant in milliseconds
hpi_err_t HPI_MeterGetPeakBallistics ( const hpi_hsubsys_t *  phSubSys,
hpi_handle_t  hControl,
uint16_t *  pnAttack,
uint16_t *  pnDecay 
)

Get the ballistics settings of the Peak part of a meter.

Returns:
0 on success, or one of the HPI_ERROR_CODES.
Parameters:
phSubSysVestigial subsys handle (unused), may be set to NULL
hControlHandle to control of type HPI_CONTROL_METER
pnAttackAttack timeconstant in milliseconds
pnDecayDecay timeconstant in milliseconds