public void ShowVoice(byte[] data, MicrophoneInput mic) { showVoice = true; detail.TalkingFlag_Image.gameObject.SetActive(showVoice); float length = mic.Play(data); Game.Delay(length, () => { showVoice = false; detail.TalkingFlag_Image.gameObject.SetActive(showVoice); }); }
public void InputSelectValueChangedHandler(Dropdown mic) { string selectedInput = options[inputSelect.value]; switch (selectedInput) { case "Music": audioVizualizer.audioSource = music.GetAudioSource(); music.Play(); microphone.Stop(); break; case "Microphone": audioVizualizer.audioSource = microphone.GetAudioSource(); music.Pause(); microphone.Play(); break; } }