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

MediaStream

public abstract class MediaStream : IDisposable

Base stream

Constructors

NameDescription
MediaStream(OdinMediaConfig)Base stream

Properties

NameDescription
IdHandle ID
MediaConfigAudio config of the media stream
CancellationSourceControl of async read and write tasks
IsActiveIndicates wether or not the media stream is active and sending/receiving data
HasErrorsIndicates wether or not the last media stream api call result is an error code
IsInvalidIndicates 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