void Start() { Instance = this; for (int i = 0; i < audioObj.Length; i++) { audioObj[i].player = (GameObject)Instantiate(playerPrefab); audioObj[i].player.transform.parent = transform; audioObj[i].player.transform.position = Vector3.zero; audioObj[i].clip = new AudioClip(); } inputDevices = new string[Microphone.devices.Length]; deviceNum = Microphone.devices.Length - 1; for (int i = 0; i < Microphone.devices.Length; i++) { inputDevices[i] = Microphone.devices[i].ToString(); } CurrentAudioInput = Microphone.devices[deviceNum].ToString(); InvokeRepeating("Check", 0, 1.0f / 15.0f); StartCoroutine(StartRecord()); }
public AudioHandler(VoiceControl voiceControl) { timerPlay = new Timer(); timerPlay.Interval = 1000; timerPlay.Tick += new System.EventHandler(OnTimerPlayEvent); timerPlay.Enabled = false; this.voiceControl = voiceControl; }
// Start is called before the first frame update void Start() { rb = GetComponent <Rigidbody2D>(); Player = GameObject.FindGameObjectWithTag("Player"); voiceControl = Player.GetComponent <VoiceControl>(); rb.velocity = new Vector2(0, voiceControl.GetUIMoveSpeed()); Destroy(gameObject, voiceControl.GetUIDuration()); }
void Start() { Instance = this; for (int i = 0; i < audioObj.Length; i++) { audioObj[i].player = (GameObject)Instantiate(playerPrefab); audioObj[i].player.transform.parent = transform; audioObj[i].player.transform.position = Vector3.zero; audioObj[i].clip = new AudioClip(); } inputDevices = new string[Microphone.devices.Length]; deviceNum = Microphone.devices.Length - 1; for (int i = 0; i < Microphone.devices.Length; i++) inputDevices[i] = Microphone.devices[i].ToString(); CurrentAudioInput = Microphone.devices[deviceNum].ToString(); InvokeRepeating("Check", 0, 1.0f / 15.0f); StartCoroutine(StartRecord()); }
private void Start() { GameObject ship = GameObject.FindGameObjectWithTag("Player"); vc = ship.GetComponent <VoiceControl>(); }
public KeyboardHandler(VoiceControl voiceControl) { this.voiceControl = voiceControl; }