- Home /
What does AudioClip.GetData give me?
I've discovered the GetData function from the AudioClip object and am confused as to what I'm actually getting?
Is it pitch or amplitude or volume or what? I would love to get into music visualization and whatnot, but it's hard for me to figure that out through research if I don't even know what I'm being given. I understand that I need to get my Highs, Lows, and Mediums, but I'm not even sure how to read the data I'm being given.
Thanks for any and all help =)
Answer by MakeCodeNow · Apr 26, 2014 at 07:00 PM
It gives you PCM audio, like what is stored on an audio CD. It's samples of amplitude over time. Note that this function does not work for some (all?) compressed audio formats.
So let's say I want to get my Lows, Highs, and $$anonymous$$ediums. I suppose considering this is Amplitude - not frequency - I would have to manually figure out the frequencies of the clip to find my pitch? Say, sampling the next x samples and finding it's delta (rate of change)? Forgive me if my knowledge on audio is incorrect, I've done little research at the present time.
You want to do an FFT on your audio. You can do it yourself on the data returned by AudioClip.GetData, play the AudioClip on an AudioSource and use GetSpectrumData.
Your answer
Follow this Question
Related Questions
How can i create an AudioClip from byte array? 0 Answers
C sharp cant play Audio 2 Answers
How do I setup music for optimal playback on iOS? 0 Answers
Music will not change when an event triggers it 3 Answers
AudioClip Precise Timing and Delay 1 Answer