Class AudioSource
Class for sending sourced audio (from a microphone or a recording) to a remote endpoint via RTP packets over an RtpChannel. This class also manages sending DTMF events over the RtpChannel.
Refer to The AudioSource Class for a detailed description of this class.
Inherited Members
Namespace: SipLib.Media
Assembly: SipLib.dll
Syntax
public class AudioSource
Constructors
| Edit this page View SourceAudioSource(MediaDescription, IAudioEncoder, RtpChannel)
Constructor
Declaration
public AudioSource(MediaDescription AnsweredMediaDescription, IAudioEncoder Encoder, RtpChannel rtpChannel)
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. |
IAudioEncoder | Encoder | IAudioEncoder to use to encode linear 16-bit PCM sample data that will be sent on the RtpChannel |
RtpChannel | rtpChannel | The RtpChannel to send RTP packets on |
Methods
| Edit this page View SourceClearAudioSampleSource()
Clears the current sample source. This method must be called when the audio session for a call ends.
Declaration
public void ClearAudioSampleSource()
SendDtmfEvent(DtmfEventEnum)
Sends a DTMF event. This event sends a single DTMF event. The event length is 80 ms and three end packets are sent. This class does not ensure the minimum inter-digit gap of 40 ms so the application is responsible for doing this. Ensuring the minimum inter-digit gap is not an issue because DTMF digits are typically sent by a user by typing them on a keypad.
Declaration
public void SendDtmfEvent(DtmfEventEnum dtmfEvent)
Parameters
Type | Name | Description |
---|---|---|
DtmfEventEnum | dtmfEvent | Event to send. |
SetAudioSampleSource(IAudioSampleSource)
Sets the IAudioSampleSource for this AudioSource and starts it sending RTP packets. If there is a previous IAudioSampleSource set, then this method replaces it with the new IAudioSampleSource.
Declaration
public void SetAudioSampleSource(IAudioSampleSource audioSampleSource)
Parameters
Type | Name | Description |
---|---|---|
IAudioSampleSource | audioSampleSource | New source of the audio samples. |
Start()
Starts transmission of RTP packets. It is not not necessary to call this method after calling the SetAudioSampleSource() method. This method can be called after the Stop() method was called to re-start transmission of RTP packets.
Declaration
public void Start()
Stop()
Stops transmission of RTP packets. This is the same as Pause.
Declaration
public void Stop()