// Button pressed public void ButtonPressed() { if (microphone.IsRecording) { // Stop recording microphone.StopRecording(); buttonText.text = "Start"; } else { // Start recording microphone.StartRecording(); buttonText.text = "Stop"; } }
// Use this for initialization void Start() { microphone = GetComponent <MicDecode>(); microphone.StartRecording(); StartCoroutine(TestEveryBeat()); }