Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Update () {
- float[] spectrum = AudioListener.GetSpectrumData(128, 0, FFTWindow.BlackmanHarris);
- float spec = 0;
- for (int i = 0; i < 128; i++ )
- spec += spectrum[i];
- myScript.intensity = (0.3f - 0.15f) * spec+0.15f;
- }
Advertisement
Add Comment
Please, Sign In to add comment