Burnner

Untitled

Mar 25th, 2015
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.31 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.          Debug.Log(spec);
  9.  
  10.          myScript.intensity = (0.3f - 0.15f * spec)+0.15f;
  11.     }
Advertisement
Add Comment
Please, Sign In to add comment