Class AudioSource
Class for sending sourced audio (from a microphone or a recording) to a remote endpoint via RTP packets over an RtpChannel.
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 SourcePause()
Pauses transmission of RTP packets.
Declaration
public virtual void Pause()
Resume()
Resumes generation and transmission of RTP packets.
Declaration
public virtual void Resume()
SendAudioSamples(short[], int)
The IAudioSampleSource object that is providing audio samples will call this method to send new audio samples to the remote endpoint via the RtpChannel.
Declaration
public void SendAudioSamples(short[] AudioSamples, int SampleRate)
Parameters
Type | Name | Description |
---|---|---|
short[] | AudioSamples | Contains the new audio samples to send. Must be 16-bit, linear PCM samples. |
int | SampleRate | Sample rate in samples per second of the AudioSamples. Must be either 8000 or 16000 |
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. |
Start()
Declaration
public void Start()
Stop()
Declaration
public void Stop()