class H323AudioCodec: public H323Codec

This class defines a codec class that will use the standard platform PCM output device.

Inheritance:


Public Methods

[more] H323AudioCodec ( const char * mediaFormat, Direction direction )
Create a new audio codec.
[more]virtual BOOL Open ( H323Connection & connection )
Open the codec.
[more]virtual void Close ()
Close down the codec.
[more]virtual unsigned GetFrameRate () const
Get the frame rate in RTP timestamp units
[more]void SetSilenceDetectionMode ( SilenceDetectionMode mode, unsigned threshold = 0, unsigned signalDeadband = 80, unsigned silenceDeadband = 3200, unsigned adaptivePeriod = 4800 )
Enable/Disable silence detection.
[more]SilenceDetectionMode GetSilenceDetectionMode ( BOOL * isInTalkBurst = NULL, unsigned * currentThreshold = NULL ) const
Get silence detection mode
[more]virtual BOOL DetectSilence ()
Check frame for a talk burst.
[more]virtual unsigned GetAverageSignalLevel ()
Get the average signal level in the audio stream.


Inherited from H323Codec:

Public Methods

ovirtual BOOL Read( BYTE * buffer, unsigned & length, RTP_DataFrame & rtpFrame )
ovirtual BOOL Write( const BYTE * buffer, unsigned length, const RTP_DataFrame & frame, unsigned & written )
ovirtual void OnFlowControl( long bitRateRestriction )
ovirtual void OnMiscellaneousCommand( const H245_MiscellaneousCommand_type & type )
ovirtual void OnMiscellaneousIndication( const H245_MiscellaneousIndication_type & type )
ovirtual BOOL AttachChannel( PChannel * channel, BOOL autoDelete = TRUE )
ovirtual BOOL CloseRawDataChannel()

Protected Fields

oBOOL deleteChannel


Documentation

This class defines a codec class that will use the standard platform PCM output device.

An application may create a descendent off this class and override functions as required for descibing a specific codec.

o H323AudioCodec( const char * mediaFormat, Direction direction )
Create a new audio codec. This opens the standard PCM audio output device, for input and output and allows descendent codec classes to do audio I/O after decoding/encoding.
Parameters:
mediaFormat - Media format for codec
direction - Direction in which this instance runs

ovirtual BOOL Open( H323Connection & connection )
Open the codec. This will open the codec for encoding or decoding. This is primarily used to delay allocation of resources until the last minute.

The default behaviour calls the H323EndPoint::OpenAudioChannel() function and assigns the result of that function to the raw data channel in the H323Codec class.

Parameters:
connection - Connection between the endpoints

ovirtual void Close()
Close down the codec. This will close the codec breaking any block on the Read() or Write() functions.

The default behaviour will close the rawDataChannel if it is not NULL and thene delete it if delteChannel is TRUE.

ovirtual unsigned GetFrameRate() const
Get the frame rate in RTP timestamp units

ovoid SetSilenceDetectionMode( SilenceDetectionMode mode, unsigned threshold = 0, unsigned signalDeadband = 80, unsigned silenceDeadband = 3200, unsigned adaptivePeriod = 4800 )
Enable/Disable silence detection. The deadband periods are in audio samples of 8kHz.
Parameters:
mode - New silence detection mode
threshold - Threshold value if FixedSilenceDetection
signalDeadband - 10 milliseconds of signal needed
silenceDeadband - 400 milliseconds of silence needed
adaptivePeriod - 600 millisecond window for adaptive threshold

oSilenceDetectionMode GetSilenceDetectionMode( BOOL * isInTalkBurst = NULL, unsigned * currentThreshold = NULL ) const
Get silence detection mode

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.

ovirtual BOOL DetectSilence()
Check frame for a talk burst. This does the deadband calculations on the average signal levels returned by the GetAverageSignalLevel() function and based on the levelThreshold, signalDeadbandFrames and silenceDeadbandFrames member variables.

ovirtual unsigned GetAverageSignalLevel()
Get the average signal level in the audio stream. This is called from within DetectSilence() to calculate the average signal level since the last call to DetectSilence().

The default behaviour returns UINT_MAX which disables the silence detection algorithm.


Direct child classes:
H323_LIDCodec
H323FramedAudioCodec

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.