- Home /
Question by
GarrettJohnson · Jun 28, 2012 at 08:36 PM ·
audiosoundaudioclipreverse
"Cannot get/set data from streamed sample" from audioclip
I'm trying to reverse an audioclip at run time using the "getData" and "setData" functions. However, whenever I try to use either of those functions, I get this error:
Cannot get/set data from streamed sample UnityEngine.AudioClip:GetData(Single[], Int32)
The audio I'm using in the clip is a .wav set to "Load into Memory". Is there anything else I need to do?
Comment
Answer by Hadi_N · Apr 02, 2016 at 05:23 AM
I know this is an ancient question but i just had the same problem.
It's because when your script is sampling audio data and attempting to modify them, the audio data must be available as a chunk and not streamed or compressed.
Just modify the audio clip's load type to "Decompress on load".
getdata-problem.jpg
(28.5 kB)