Пример #1
0
        private void Update()
        {
            // Find the UnityBroadcastController
            if (m_BroadcastController == null)
            {
                UnityEngine.Object[] arr = GameObject.FindObjectsOfType(typeof(UnityBroadcastController));
                if (arr != null && arr.Length > 0)
                {
                    m_BroadcastController = arr[0] as UnityBroadcastController;
                    m_Api = m_BroadcastController.UnityBroadcastApi;
                    m_AudioQueue = m_BroadcastController.PassthroughAudioQueue;
                    m_SampleRate = AudioSettings.outputSampleRate;
                    m_UsingPassthroughAudio = m_BroadcastController.AudioCaptureMethod == BroadcastController.GameAudioCaptureMethod.Passthrough;

                    // We don't need to receive samples if the system isn't configured for passthrough
                    if (!m_UsingPassthroughAudio)
                    {
                        // NOTE: There is currently no way to reenable the capturer if the game changes the capture method at runtime but this should never be the case
                        this.enabled = false;
                    }
                }
            }
        }
Пример #2
0
        private void Update()
        {
            // Find the UnityBroadcastController
            if (m_BroadcastController == null)
            {
                UnityEngine.Object[] arr = GameObject.FindObjectsOfType(typeof(UnityBroadcastController));
                if (arr != null && arr.Length > 0)
                {
                    m_BroadcastController = arr[0] as UnityBroadcastController;
                    m_Api                   = m_BroadcastController.UnityBroadcastApi;
                    m_AudioQueue            = m_BroadcastController.PassthroughAudioQueue;
                    m_SampleRate            = AudioSettings.outputSampleRate;
                    m_UsingPassthroughAudio = m_BroadcastController.AudioCaptureMethod == BroadcastController.GameAudioCaptureMethod.Passthrough;

                    // We don't need to receive samples if the system isn't configured for passthrough
                    if (!m_UsingPassthroughAudio)
                    {
                        // NOTE: There is currently no way to reenable the capturer if the game changes the capture method at runtime but this should never be the case
                        this.enabled = false;
                    }
                }
            }
        }