Show / Hide Table of Contents

    Class RemoteAudioSource

    This component represents a remote audio source added as an audio track to an existing WebRTC peer connection by a remote peer and received locally. The audio track can optionally be displayed locally with a MediaPlayer.

    Inheritance
    Object
    AudioSource
    RemoteAudioSource
    Inherited Members
    AudioSource.AudioStreamStarted
    AudioSource.AudioStreamStopped
    Namespace: Microsoft.MixedReality.WebRTC.Unity
    Assembly: cs.temp.dll.dll
    Syntax
    public class RemoteAudioSource : AudioSource

    Fields

    AutoPlayOnAdded

    Automatically play the remote audio track when it is added.

    Declaration
    public bool AutoPlayOnAdded
    Field Value
    Type Description
    Boolean

    PeerConnection

    Peer connection this remote audio source is extracted from.

    Declaration
    public PeerConnection PeerConnection
    Field Value
    Type Description
    PeerConnection

    Properties

    IsPlaying

    Is the audio source currently playing? The concept of playing is described in the Play() function.

    Declaration
    public bool IsPlaying { get; }
    Property Value
    Type Description
    Boolean
    See Also
    Play()
    Stop()

    Methods

    Awake()

    Implementation of MonoBehaviour.Awake which registers some handlers with the peer connection to listen to its OnInitialized and OnShutdown events.

    Declaration
    protected void Awake()

    OnDestroy()

    Implementation of MonoBehaviour.OnDestroy which unregisters all listeners from the peer connection.

    Declaration
    protected void OnDestroy()

    Play()

    Manually start playback of the remote audio feed by registering some listeners to the peer connection and starting to enqueue audio frames as they become ready.

    If AutoPlayOnAdded is true then this is called automatically as soon as the peer connection is initialized.

    Declaration
    public void Play()
    Remarks

    This is only valid while the peer connection is initialized, that is after the OnInitialized event was fired.

    See Also
    Stop()
    IsPlaying

    Stop()

    Stop playback of the remote audio feed and unregister the handler listening to remote video frames.

    Note that this is independent of whether or not a remote track is actually present. In particular this does not fire the AudioStreamStopped, which corresponds to a track being made available to the local peer by the remote peer.

    Declaration
    public void Stop()
    See Also
    Play()
    IsPlaying

    Update()

    Implementation of MonoBehaviour.Update to execute from the current Unity main thread any background work enqueued from free-threaded callbacks.

    Declaration
    protected void Update()
    Back to top Generated by DocFX