Show / Hide Table of Contents

Class AudioStream

Inheritance
System.Object
MediaStream
AudioStream
Inherited Members
MediaStream._pendingPackagesLock
MediaStream._pendingPackagesBuffer
MediaStream.SecureContext
MediaStream.SrtpHandler
MediaStream.rtpChannel
MediaStream._isClosed
MediaStream.Index
MediaStream.OnTimeoutByIndex
MediaStream.OnSendReportByIndex
MediaStream.OnRtpPacketReceivedByIndex
MediaStream.OnRtpHeaderReceivedByIndex
MediaStream.OnRtpEventByIndex
MediaStream.OnReceiveReportByIndex
MediaStream.OnIsClosedStateChanged
MediaStream.AcceptRtpFromAny
MediaStream.IsClosed
MediaStream.RemoteRtpEventPayloadID
MediaStream.MediaType
MediaStream.LocalTrack
MediaStream.RemoteTrack
MediaStream.RtcpSession
MediaStream.DestinationEndPoint
MediaStream.ControlDestinationEndPoint
MediaStream.DefaultRTPEventFormat
MediaStream.AddBuffer(TimeSpan)
MediaStream.RemoveBuffer(TimeSpan)
MediaStream.UseBuffer()
MediaStream.GetBuffer()
MediaStream.SetSecurityContext(ProtectRtpPacket, ProtectRtpPacket, ProtectRtpPacket, ProtectRtpPacket)
MediaStream.GetSecurityContext()
MediaStream.IsSecurityContextReady()
MediaStream.EnsureBufferUnprotected(Byte[], RTPHeader, RTPPacket)
MediaStream.GetOrCreateSrtpHandler()
MediaStream.AddRtpChannel(RTPChannel)
MediaStream.HasRtpChannel()
MediaStream.GetRTPChannel()
MediaStream.CheckIfCanSendRtpRaw()
MediaStream.SendRtpRaw(Byte[], UInt32, Int32, Int32, Boolean, Nullable<UInt16>)
MediaStream.SetRtpHeaderExtensionValue(String, Object)
MediaStream.SendRtpRaw(Byte[], UInt32, Int32, Int32, UInt16)
MediaStream.SendRtpRaw(Byte[], UInt32, Int32, Int32)
MediaStream.SendRtcpRaw(Byte[])
MediaStream.SendRtcpReport(RTCPCompoundPacket)
MediaStream.SendRtcpFeedback(RTCPFeedback)
MediaStream.OnReceiveRTPPacket(RTPHeader, Int32, IPEndPoint, Byte[], VideoStream)
MediaStream.RaiseOnReceiveReportByIndex(IPEndPoint, RTCPCompoundPacket)
MediaStream.RaiseOnRtpEventByIndex(IPEndPoint, RTPEvent, RTPHeader)
MediaStream.RaiseOnRtpPacketReceivedByIndex(IPEndPoint, RTPPacket)
MediaStream.DispatchPendingPackages()
MediaStream.ClearPendingPackages()
MediaStream.AddPendingPackage(RTPHeader, Int32, IPEndPoint, Byte[], VideoStream)
MediaStream.LogIfWrongSeqNumber(String, RTPHeader, MediaStreamTrack)
MediaStream.AdjustRemoteEndPoint(UInt32, IPEndPoint)
MediaStream.CreateRtcpSession()
MediaStream.SetDestination(IPEndPoint, IPEndPoint)
MediaStream.GetSendingFormat()
MediaStream.ProcessHeaderExtensions(RTPHeader, IPEndPoint)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: SIPSorcery.net.RTP
Assembly: SIPSorcery.dll
Syntax
public class AudioStream : MediaStream

Constructors

| Improve this Doc View Source

AudioStream(RtpSessionConfig, Int32)

Declaration
public AudioStream(RtpSessionConfig config, int index)
Parameters
Type Name Description
RtpSessionConfig config
System.Int32 index

Fields

| Improve this Doc View Source

logger

Declaration
protected static ILogger logger
Field Value
Type Description
Microsoft.Extensions.Logging.ILogger
| Improve this Doc View Source

rtpEventInProgress

Declaration
protected bool rtpEventInProgress
Field Value
Type Description
System.Boolean

Properties

| Improve this Doc View Source

HasAudio

Indicates whether this session is using audio.

Declaration
public bool HasAudio { get; }
Property Value
Type Description
System.Boolean

Methods

| Improve this Doc View Source

CheckAudioFormatsNegotiation()

Declaration
public void CheckAudioFormatsNegotiation()
| Improve this Doc View Source

SendAudio(UInt32, Byte[])

Sends an audio sample to the remote peer.

Declaration
public void SendAudio(uint durationRtpUnits, byte[] sample)
Parameters
Type Name Description
System.UInt32 durationRtpUnits

The duration in RTP timestamp units of the audio sample. This value is added to the previous RTP timestamp when building the RTP header.

System.Byte[] sample

The audio sample to set as the RTP packet payload.

| Improve this Doc View Source

SendAudioFrame(UInt32, Int32, Byte[])

Sends an audio packet to the remote party.

Declaration
public void SendAudioFrame(uint duration, int payloadTypeID, byte[] buffer)
Parameters
Type Name Description
System.UInt32 duration

The duration of the audio payload in timestamp units. This value gets added onto the timestamp being set in the RTP header.

System.Int32 payloadTypeID

The payload ID to set in the RTP header.

System.Byte[] buffer

The audio payload to send.

| Improve this Doc View Source

SendDtmf(Byte, CancellationToken)

Sends a DTMF tone as an RTP event to the remote party.

Declaration
public virtual Task SendDtmf(byte key, CancellationToken ct)
Parameters
Type Name Description
System.Byte key

The DTMF tone to send.

System.Threading.CancellationToken ct

RTP events can span multiple RTP packets. This token can be used to cancel the send.

Returns
Type Description
System.Threading.Tasks.Task
| Improve this Doc View Source

SendDtmfEvent(RTPEvent, CancellationToken, Int32, Int32)

Sends an RTP event for a DTMF tone as per RFC2833. Sending the event requires multiple packets to be sent. This method will hold onto the socket until all the packets required for the event have been sent. The send can be cancelled using the cancellation token.

Declaration
public async Task SendDtmfEvent(RTPEvent rtpEvent, CancellationToken cancellationToken, int clockRate = 8000, int samplePeriod = 50)
Parameters
Type Name Description
RTPEvent rtpEvent

The RTP event to send.

System.Threading.CancellationToken cancellationToken

CancellationToken to allow the operation to be cancelled prematurely.

System.Int32 clockRate

To send an RTP event the clock rate of the underlying stream needs to be known.

System.Int32 samplePeriod

The sample period in milliseconds being used for the media stream that the event is being inserted into. Should be set to 50ms if main media stream is dynamic or sample period is unknown.

Returns
Type Description
System.Threading.Tasks.Task

Events

| Improve this Doc View Source

OnAudioFormatsNegotiatedByIndex

Gets fired when the remote SDP is received and the set of common audio formats is set.

Declaration
public event Action<int, List<AudioFormat>> OnAudioFormatsNegotiatedByIndex
Event Type
Type Description
System.Action<System.Int32, System.Collections.Generic.List<SIPSorceryMedia.Abstractions.AudioFormat>>

Extension Methods

JSONWriter.ToJson(Object)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX