Burnner

Untitled

Mar 25th, 2015
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.28 KB | None | 0 0
  1.     void Update () {
  2.         float[] spectrum = AudioListener.GetSpectrumData(128, 0, FFTWindow.BlackmanHarris);
  3.        
  4.          float spec = 0;
  5.          for (int i = 0; i < 128; i++ )
  6.              spec += spectrum[i];
  7.  
  8.          myScript.intensity = (0.3f - 0.15f) * spec+0.15f;
  9.     }
Advertisement
Add Comment
Please, Sign In to add comment