Developer Documentation
Our new developer documentation is now available. Please check it out!

MediaStream

public abstract class MediaStream : IDisposable

Base stream

Properties

NameTypeDescription
IdInt64Handle ID
MediaConfigOdinMediaConfigAudio config of the media stream
CancellationSourceCancellationTokenSourceControl of async read and write tasks
IsActiveBooleanIndicates wether or not the media stream is active and sending/receiving data
HasErrorsBooleanIndicates wether or not the last media stream api call result is an error code
IsInvalidBooleanIndicates wether or not the media stream handle is invalid or closed

Public Methods

NameDescription
GetMediaIdReturns the media stream ID and updates Id.
GetPeerIdReturns the ID of the peer that own this media stream.
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.
AudioReset
AudioReadDataReads data from the audio stream.
AudioStatsRetrieves statistics for the specified Media.
AudioReadDataTaskReads data from the audio stream.
AudioReadDataAsyncRead audio data using a custom custom CancellationSource.
AudioResampleSet a resampler and resamples a chunk of audio.
CancelCancel the custom CancellationSource.
ToStringDebug
DisposeOn dispose will free the stream and resampler