OPAL  Version 3.14.3
OpalSilenceDetector Class Referenceabstract

#include <silencedetect.h>

Inheritance diagram for OpalSilenceDetector:

Data Structures

struct  Params
 

Public Types

typedef Modes Mode
 

Public Member Functions

 P_DECLARE_STREAMABLE_ENUM (Modes, NoSilenceDetection, FixedSilenceDetection, AdaptiveSilenceDetection)
 
Construction
 OpalSilenceDetector (const Params &newParam)
 

Basic operations

PNotifier receiveHandler
 
Mode mode
 
unsigned signalDeadband
 
unsigned silenceDeadband
 
unsigned adaptivePeriod
 
unsigned clockRate
 
unsigned lastTimestamp
 
unsigned receivedTime
 
unsigned levelThreshold
 
unsigned signalMinimum
 
unsigned silenceMaximum
 
unsigned signalReceivedTime
 
unsigned silenceReceivedTime
 
bool inTalkBurst
 
PMutex inUse
 
const PNotifier & GetReceiveHandler () const
 
void SetParameters (const Params &params, const int clockRate=0)
 
void GetParameters (Params &params)
 
void SetClockRate (unsigned clockRate)
 
unsigned GetClockRate () const
 
Mode GetStatus (PBoolean *isInTalkBurst, unsigned *currentThreshold) const
 
virtual unsigned GetAverageSignalLevel (const BYTE *buffer, PINDEX size)=0
 
 PDECLARE_NOTIFIER (RTP_DataFrame, OpalSilenceDetector, ReceivedPacket)
 

Member Typedef Documentation

Constructor & Destructor Documentation

OpalSilenceDetector::OpalSilenceDetector ( const Params newParam)

Create a new detector. Default clock rate is 8000.

Parameters
newParamNew parameters for silence detector

Member Function Documentation

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
bufferRTP payload being detected
sizeSize 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

References receiveHandler.

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   
)
OpalSilenceDetector::PDECLARE_NOTIFIER ( RTP_DataFrame  ,
OpalSilenceDetector  ,
ReceivedPacket   
)
protected
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
clockRateSampling 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
paramsNew parameters for silence detector
clockRateSampling clock rate for the preprocessor

Field Documentation

unsigned OpalSilenceDetector::adaptivePeriod
protected
unsigned OpalSilenceDetector::clockRate
protected

Referenced by GetClockRate().

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

Referenced by GetReceiveHandler().

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: