Exemplo n.º 1
0
        public override bool BeginRecording()
        {
            if (m_recording)
            {
                return(false);
            }

            m_outputDir.CreateDirectory();

            // initialize encoder
            {
                string outPath = m_outputDir.GetFullPath() + "/" + DateTime.Now.ToString("yyyyMMdd_HHmmss");

                m_encoderConfigs.Setup();
                m_encoder = AudioEncoder.Create(m_encoderConfigs, outPath);
                if (m_encoder == null || !m_encoder.IsValid())
                {
                    EndRecording();
                    return(false);
                }
            }

            base.BeginRecording();
            Debug.Log("AudioMRecorder: BeginRecording()");
            return(true);
        }
Exemplo n.º 2
0
        public override bool BeginRecording()
        {
            if (m_recording)
            {
                return(false);
            }

            m_outputDir.CreateDirectory();

            // initialize encoder
            {
                string outPath = m_outputDir.GetFullPath() + "/" + DateTime.Now.ToString("yyyyMMdd_HHmmss");

                m_encoderConfigs.Setup();
                m_encoder = AudioEncoder.Create(m_encoderConfigs, outPath);
                if (m_encoder == null)
                {
                    EndRecording();
                    return(false);
                }
            }

            m_initialTime     = Time.unscaledTime;
            m_recordedFrames  = 0;
            m_recordedSamples = 0;
            m_recording       = true;

            Debug.Log("AudioMRecorder: BeginRecording()");
            return(true);
        }