Exemplo n.º 1
0
 private void Update()
 {
     // If we press our key, we toggle our microphone.
     if (Input.GetKeyDown(toggleRecordingKey))
     {
         if (!Microphone.IsRecording(mic.Name))
         {
             mic.BeginRecording();
         }
         else
         {
             mic.EndRecording();
         }
     }
 }
Exemplo n.º 2
0
 public void startRecording()
 {
     if (!Microphone.IsRecording(mic.Name))
     {
         mic.BeginRecording();
     }
 }
Exemplo n.º 3
0
 private void Update()
 {
     // If we press our key, we toggle our microphone.
     if (uiManager.micConnected)
     {
         if (Input.GetKeyDown(toggleRecordingKey))
         {
             if (!Microphone.IsRecording(mic.Name))
             {
                 mic.BeginRecording();
                 uiManager.UpdateMicIndicator(new Color(1, 1, 0, 1));
             }
             else
             {
                 mic.EndRecording();
                 uiManager.UpdateMicIndicator(new Color(1, 0, 0, 1));
                 StartCoroutine(ResetMicIndicator());
             }
         }
     }
 }