#include <silencedetect.h>
OpalSilenceDetector::OpalSilenceDetector |
( |
const Params & |
newParam | ) |
|
Create a new detector. Default clock rate is 8000.
- Parameters
-
newParam | New parameters for silence detector |
virtual unsigned OpalSilenceDetector::GetAverageSignalLevel |
( |
const BYTE * |
buffer, |
|
|
PINDEX |
size |
|
) |
| |
|
pure virtual |
Get the average signal level in the stream. This is called from within the silence detection algorithm to calculate the average signal level of the last data frame read from the stream.
The default behaviour returns UINT_MAX which indicates that the average signal has no meaning for the stream.
- Parameters
-
buffer | RTP payload being detected |
size | Size of payload buffer |
Implemented in OpalLineSilenceDetector, and OpalPCM16SilenceDetector.
unsigned OpalSilenceDetector::GetClockRate |
( |
| ) |
const |
|
inline |
Get the current sampling clock rate.
References clockRate.
void OpalSilenceDetector::GetParameters |
( |
Params & |
params | ) |
|
Get the current parameters in use.
const PNotifier& OpalSilenceDetector::GetReceiveHandler |
( |
| ) |
const |
|
inline |
Mode OpalSilenceDetector::GetStatus |
( |
PBoolean * |
isInTalkBurst, |
|
|
unsigned * |
currentThreshold |
|
) |
| const |
Get silence detection status
The inTalkBurst value is true if packet transmission is enabled and false if it is being suppressed due to silence.
The currentThreshold value is the value from 0 to 32767 which is used as the threshold value for 16 bit PCM data.
OpalSilenceDetector::P_DECLARE_STREAMABLE_ENUM |
( |
Modes |
, |
|
|
NoSilenceDetection |
, |
|
|
FixedSilenceDetection |
, |
|
|
AdaptiveSilenceDetection |
|
|
) |
| |
void OpalSilenceDetector::SetClockRate |
( |
unsigned |
clockRate | ) |
|
Set the sampling clock rate for the preprocessor. Adusts the interpretation of time values. This may be called while audio is being transferred, but if in adaptive mode calling this will reset the filter.
- Parameters
-
clockRate | Sampling clock rate for the preprocessor |
void OpalSilenceDetector::SetParameters |
( |
const Params & |
params, |
|
|
const int |
clockRate = 0 |
|
) |
| |
Set the silence detector parameters. This adjusts the silence detector "agression". The deadband and adaptive periods are in ms units to work for any clock rate. The clock rate value is optional: 0 leaves value unchanged. This may be called while audio is being transferred, but if in adaptive mode calling this will reset the filter.
- Parameters
-
params | New parameters for silence detector |
clockRate | Sampling clock rate for the preprocessor |
unsigned OpalSilenceDetector::adaptivePeriod |
|
protected |
unsigned OpalSilenceDetector::clockRate |
|
protected |
bool OpalSilenceDetector::inTalkBurst |
|
protected |
PMutex OpalSilenceDetector::inUse |
|
protected |
unsigned OpalSilenceDetector::lastTimestamp |
|
protected |
unsigned OpalSilenceDetector::levelThreshold |
|
protected |
Mode OpalSilenceDetector::mode |
|
protected |
unsigned OpalSilenceDetector::receivedTime |
|
protected |
PNotifier OpalSilenceDetector::receiveHandler |
|
protected |
unsigned OpalSilenceDetector::signalDeadband |
|
protected |
unsigned OpalSilenceDetector::signalMinimum |
|
protected |
unsigned OpalSilenceDetector::signalReceivedTime |
|
protected |
unsigned OpalSilenceDetector::silenceDeadband |
|
protected |
unsigned OpalSilenceDetector::silenceMaximum |
|
protected |
unsigned OpalSilenceDetector::silenceReceivedTime |
|
protected |
The documentation for this class was generated from the following file: