Different output ....

my script is following …

private var volume:float;
private var inRecord:boolean=false;

private var temp:GameObject;

function Start(){
	temp=GameObject.CreatePrimitive(PrimitiveType.Cube);
	temp.transform.position=Vector3(0,0,0);
	temp.active=true;
}

function Update() {
	if(!audio.isPlaying){
		inRecord=false;
		recordSound();
	}else{
		inRecord=true;
	}
	
	volume=analyzeSound();
	
	
	if(temp.active && volume >.038){
		temp.active=false;
		audio.clip=null;
	}
}


function recordSound(){
	audio.loop=true;
	audio.mute=true;
	audio.clip=Microphone.Start("",true,1,24000);
	while (!(Microphone.GetPosition("Built-in Microphone") > 0)) {

    }
    audio.Play();
}

function analyzeSound():float{
	var data:float[]=new float[256];
	var vol:float;
	audio.GetSpectrumData(data,0,FFTWindow.Rectangular);
	for(var i=0;i<256;i++){
		vol+=Mathf.Abs(data*);*
  • }*
  • data=null;*
  • return vol/256;*

}
I am getting Different value on different devices .why is it so .

Nothing is absolute, as Einstein said time is relative, so are results, it deppends on the observer, it is because particles are affected sometimes by intention. It is quantum physics and it demonstrates some behaviours at subatomic level, it helps scientists understand how some things happen, and it also happens on machines. Look at the movie “WHAt the bleep do you know”. It may be the answer to your problem. It has also happened to me, try to restrict your script with absolute values, if your variables are relative, so will be the results!