Class AudioDestination
This class receives audio RTP packets from an RtpChannel, decodes them and sends them to an audio destination by calling a delegate function that processes the received audio samples.
The clock rate (sample rate) of the audio handled by this class must be either 8000 or 16000.
Inherited Members
Namespace: SipLib.Media
Assembly: SipLib.dll
Syntax
public class AudioDestination
Constructors
| Edit this page View SourceAudioDestination(MediaDescription, IAudioDecoder, RtpChannel, AudioDestinationDelegate?, int)
Constructor
Declaration
public AudioDestination(MediaDescription AnsweredMediaDescription, IAudioDecoder Decoder, RtpChannel rtpChannel, AudioDestinationDelegate? destinationHandler, int DestinationSampleRate)
Parameters
Type | Name | Description |
---|---|---|
MediaDescription | AnsweredMediaDescription | The MediaDescription object that was sent as the answer to the offered MediaDescription. This object contains the negotiated media type and codec type. |
IAudioDecoder | Decoder | IAudioDecoder to use to decode the received audio samples |
RtpChannel | rtpChannel | RtpChannel to receive audio RTP packets on. |
AudioDestinationDelegate | destinationHandler | Function to call to handle the decoded audio packets. If this is null then RTP packets are ignored. |
int | DestinationSampleRate | Sample rate expected by the destination handler |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if the audio clock rate is not 8000 or 16000. |
Methods
| Edit this page View SourceSetDestinationHandler(AudioDestinationDelegate?)
Sets the delegate function to call to process received audio packets.
Declaration
public void SetDestinationHandler(AudioDestinationDelegate? destinationHandler)
Parameters
Type | Name | Description |
---|---|---|
AudioDestinationDelegate | destinationHandler | Audio samples destination handler function. If null then received RTP packets will be ignored but DTMF events will still be processed. |
Events
| Edit this page View SourceDtmfDigitReceived
This event is fired when the end of a DTMF event is detected. This event is fired only once for each detected DTMF event even though multiple RTP packets for the same event may be received.
Declaration
public event DtmfDigitReceivedDelegate? DtmfDigitReceived
Event Type
Type | Description |
---|---|
DtmfDigitReceivedDelegate |