コード例 #1
0
        protected virtual void OnDisable()
        {
            if (Source != null)
            {
                DetachFromMediaLines();

                // Audio track sources are disposable objects owned by the user (this component)
                Source.Dispose();
                Source = null;
            }
        }
コード例 #2
0
 protected void Update()
 {
     WebRTC.AudioTrackSource source = null;
     try
     {
         source = _initHelper.Result;
     }
     catch (Exception ex)
     {
         Debug.LogError($"Failed to create device track source for {nameof(MicrophoneSource)} component '{name}'.");
         Debug.LogException(ex, this);
     }
     if (source != null)
     {
         AttachSource(source);
     }
 }
コード例 #3
0
 protected void AttachSource(WebRTC.AudioTrackSource source)
 {
     Source = source;
     AttachToMediaLines();
 }