Exemplo n.º 1
0
        public void StartInput(int maxRecordSeconds = 60)
        {
#if RTM_BUILD_NO_AUDIO
            throw new Exception("Audio is disabled, please remove the RTM_BUILD_NO_AUDIO define in \"Scripting Define Symbols\"");
#else
            if (micPhone == null)
            {
                return;
            }

            if (Microphone.devices.Length == 0)
            {
                return;
            }

            lock (selfLocker) {
                if (device == null)
                {
                    device = Microphone.devices[0];
                }

                if (isRecording)
                {
                    return;
                }
                this.maxRecordSeconds = maxRecordSeconds;
                isRecording           = true;
                clipRecord            = Microphone.Start(device, false, this.maxRecordSeconds, RECORD_SAMPLE_RATE);
                micPhone.Start();
            }
            StartCoroutine("TimeDown");
#endif
        }
Exemplo n.º 2
0
        public void StartInput()
        {
            if (micPhone == null)
            {
                return;
            }

            lock (selfLocker) {
                if (isRecording)
                {
                    return;
                }
                isRecording = true;
                clipRecord  = Microphone.Start(device, false, MAX_RECORD_SECONDS, RECORD_SAMPLE_RATE);
                micPhone.Start();
            }
            StartCoroutine("TimeDown");
        }