private IEnumerator StartRecord()
{
audioObj[index].clip = Microphone.Start(Microphone.devices[deviceNum], true, 5, 24000);
/*
the longer the mic recording time, the less often there are "hiccups" in game performance
but also due to being pitched down, the playback gradually falls farther behind the recording
*/
print("recording to audioObj " + index);
StartCoroutine(StartPlay(audioObj[index].clip));
yield return new WaitForSeconds(5);
StartCoroutine(StartRecord()); //swaps audio buffers, begins recording and playback of new buffer
/* it is necessary to swap buffers, otherwise the audioclip quickly becomes too large and begins to slow down the system */
}