protected virtual void OnDisable() { if (Source != null) { DetachFromMediaLines(); // Audio track sources are disposable objects owned by the user (this component) Source.Dispose(); Source = null; } }
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); } }
protected void AttachSource(WebRTC.AudioTrackSource source) { Source = source; AttachToMediaLines(); }