- Home /
Question by
MikeNewall · May 21, 2013 at 01:18 AM ·
audioaudiosourceaudioclip
audio.clip.GetData() returns no data.
I'm trying to get the samples from an audio clip:
void Start()
{
Float[] samples = new float[audio.clip.samples * audio.clip.channels];
audio.clip.GetData(samples, 0);
for (int i = 0; i < 10; i++)
{
Debug.Log(samples[i]);
}
}
When i print out the value of the samples in the "sample" array they're all 0... I read that this was a bug in previous versions of Unity but supposedly it was fixed? Any ideas what the problem is?
Comment