Exemple #1
0
        protected internal override void NewFrameReady(RecordingSession session)
        {
            if (!audioSettings.PreserveAudio)
            {
                return;
            }

            if (s_Handler == null)
            {
                s_Handler = this;
            }

            if (s_Handler == this)
            {
                var sampleFrameCount = AudioRenderer.GetSampleCountForCaptureFrame();
                if (RecorderOptions.VerboseMode)
                {
                    Debug.Log(string.Format("AudioInput.NewFrameReady {0} audio sample frames @ {1} ch",
                                            sampleFrameCount, m_ChannelCount));
                }

                const ushort bufferCount = 1;

                if (s_BufferManager != null)
                {
                    s_BufferManager.Dispose();
                }

                s_BufferManager = new BufferManager(bufferCount, sampleFrameCount, m_ChannelCount);

                AudioRenderer.Render(mainBuffer);
            }
        }
Exemple #2
0
        public override void EndRecording(RecordingSession session)
        {
            if (s_BufferManager != null)
            {
                s_BufferManager.Dispose();
                s_BufferManager = null;
            }

            s_Handler = null;

            if (audioSettings.preserveAudio)
            {
                AudioRenderer.Stop();
            }
        }
Exemple #3
0
        protected internal override void EndRecording(RecordingSession session)
        {
            if (s_BufferManager != null)
            {
                s_BufferManager.Dispose();
                s_BufferManager = null;
            }

            if (s_Handler == null)
            {
                return;
            }

            s_Handler = null;

            if (audioSettings.PreserveAudio)
            {
                AudioRenderer.Stop();
            }
        }