MediaStream

public abstract class MediaStream : IVideoStream, IAudioStream, IDisposable

Base stream

Properties

NameTypeDescription
IdInt64Handle ID
MediaConfigOdinMediaConfigAudio config of the media stream
CancellationSourceCancellationTokenSourceControl of async read and write tasks
IsPausedBooleanIndicates wether or not the media stream is paused
IsMutedBooleanIndicates wether or not the media stream is muted
IsActiveBooleanIndicates wether or not the media stream is active and sending/receiving data
HasErrorsBoolean
IsInvalidBoolean

Public Methods

NameDescription
GetMediaIdReturns the media stream ID and updates Id.
GetPeerIdReturns the ID of the peer that own this media stream.
SetPauseSets IsPaused.
TogglePauseToggles IsPaused.
SetMuteSets IsMuted.
ToggleMuteToggles IsMuted.
AudioPushDataSends data to the audio stream. The data has to be interleaved [-1, 1] float data.
AudioPushDataTaskSends data to the audio stream. The data has to be interleaved [-1, 1] float data.
AudioPushDataAsyncSends audio data using a custom CancellationSource. The data has to be interleaved [-1, 1] float data.
AudioReadDataReads data from the audio stream.
AudioReadDataTaskReads data from the audio stream.
AudioReadDataAsyncRead audio data using a custom custom CancellationSource.
AudioDataLengthGet the number of samples available in the audio buffer.
AudioResampleSet a resampler and resamples a chunk of audio.
CancelCancel the custom CancellationSource.
ToStringDebug
DisposeOn dispose will free the stream and resampler