Hi all, the title pretty much says it all.
Before we talk about importing configurations (such as load types and stuff like that), these are audio clips that are being recorded at runtime, each chunk is 1 second, and has to keep small since they are sent to a server in real time.
I basically create an audio clip from the microphone’s Input (using Microphone.Start), and after a chunk length’s time, I stop the mic and create a new audio clip. Each clip is added to a list, and the playback method simply iterates over every clip in the array, and plays the next element when AudioSource.isPlaying is false (meaning the current clip ended). This is the coroutine:
IEnumerator IterateOverRecordedClips()
{
source.clip = clips[0];
source.Play();
int i = 1;
while (i < clips.Count)
{
if (!source.isPlaying)
{
Debug.Log("Source stopped playing");
source.clip = clips[i];
source.Play();
i++;
}
yield return null;
}
}
So my problem is that a sharp stutter/click sound is heard after each iteration.
I’ve thought about recording 2 separate audio clips, one would be a long one that the user can playback, and the other(s) would be small chuncks that are sent to the server. The problem is that Microphone.Start returns only 1 audio clip each time.
Anybody got an idea on how to fix this? Is there a better approach to audio recording-streaming and playing back?
Thanks!