# OpalSilenceDetector Class Reference

`#include <silencedetect.h>`

Inheritance diagram for OpalSilenceDetector:

List of all members.

## Basic operations

PNotifier | receiveHandler
Params | param
bool | inTalkBurst
unsigned | lastTimestamp
unsigned | receivedTime
unsigned | levelThreshold
unsigned | signalMinimum
unsigned | silenceMaximum
unsigned | signalReceivedTime
unsigned | silenceReceivedTime
const PNotifier & | GetReceiveHandler () const
void | SetParameters (const Params &newParam)
Mode | GetStatus (PBoolean *isInTalkBurst, unsigned *currentThreshold) const
virtual unsigned | GetAverageSignalLevel (const BYTE *buffer, PINDEX size)=0
| PDECLARE_NOTIFIER (RTP_DataFrame, OpalSilenceDetector, ReceivedPacket)

## Public Types

enum | Mode { NoSilenceDetection, FixedSilenceDetection, AdaptiveSilenceDetection, NumModes }

## Classes

struct | Params

## Member Enumeration Documentation

enum OpalSilenceDetector::Mode

Enumerator:

  NoSilenceDetection |
  FixedSilenceDetection |
  AdaptiveSilenceDetection |
  NumModes |

## Constructor & Destructor Documentation

OpalSilenceDetector::OpalSilenceDetector | ( | const Params & | newParam | ) |

Create a new connection.

Parameters:

  newParam | New parameters for silence detector

OpalSilenceDetector::OpalSilenceDetector | ( | const Params & | newParam | ) |

Create a new connection.

Parameters:

  newParam | New parameters for silence detector

## Member Function Documentation

const PNotifier& OpalSilenceDetector::GetReceiveHandler | ( |  | ) | const`[inline]`

void OpalSilenceDetector::SetParameters | ( | const Params & | newParam | ) |

Set the silence detector parameters. This enables, disables the silence detector as well as adjusting its "agression". The deadband periods are in audio samples of 8kHz.

Parameters:

  newParam | New parameters for silence detector

Mode OpalSilenceDetector::GetStatus | ( | PBoolean * | isInTalkBurst,
|  | unsigned * | currentThreshold |
| ) |  |  | const

Get silence detection status

The inTalkBurst value is PTrue if packet transmission is enabled and PFalse 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.

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 OpalPCM16SilenceDetector, and OpalLineSilenceDetector.

OpalSilenceDetector::PDECLARE_NOTIFIER | ( | RTP_DataFrame | ,
|  | OpalSilenceDetector | ,
|  | ReceivedPacket |  |
| ) |  |  | `[protected]`

## Member Data Documentation

PNotifier OpalSilenceDetector::receiveHandler `[protected]`

Params OpalSilenceDetector::param `[protected]`

bool OpalSilenceDetector::inTalkBurst `[protected]`

unsigned OpalSilenceDetector::lastTimestamp `[protected]`

unsigned OpalSilenceDetector::receivedTime `[protected]`

unsigned OpalSilenceDetector::levelThreshold `[protected]`

unsigned OpalSilenceDetector::signalMinimum `[protected]`

unsigned OpalSilenceDetector::silenceMaximum `[protected]`

unsigned OpalSilenceDetector::signalReceivedTime `[protected]`

unsigned OpalSilenceDetector::silenceReceivedTime `[protected]`

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

- silencedetect.h