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

MicrophoneStream

Inherits from: MediaStream

public class MicrophoneStream : MediaStream, IVideoStream, IAudioStream, IDisposable

Representation of a write only audio stream

Public Methods

NameDescription
AudioReadDataAudioReadData and AudioReadDataAsync are not supported!
AudioReadDataTaskAudioReadData and AudioReadDataAsync are not supported!
AudioReadDataAsyncAudioReadData and AudioReadDataAsync are not supported!
AudioDataLengthGet the number of samples available in the audio buffer.

Inherited 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

Inherited 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