master
waqarulzafar 2023-02-02 22:47:05 +05:00
parent 21640ed93e
commit a1f096ab78
1 changed files with 24 additions and 15 deletions

View File

@ -343,9 +343,13 @@ export default {
Percentile(InputArray,band=0) { Percentile(InputArray,band=0) {
this.SortedArray = InputArray.sort(this.numSort);
const tempArray=[...InputArray];
this.SortedArray = tempArray.sort(this.numSort);
this.RMStoDBFS(this.SortedArray); this.RMStoDBFS(this.SortedArray);
//console.log('Sortiertes Array DBFS: ' + SortedArray); //console.log('Sortiertes Array DBFS: ' + SortedArray);
this.IndexMax = Math.round(this.SortedArray.length * this.UpperPercentile); this.IndexMax = Math.round(this.SortedArray.length * this.UpperPercentile);
@ -596,18 +600,6 @@ export default {
this.RecentRMS16000 /= 512; this.RecentRMS16000 /= 512;
this.RecentLevelValue16000= Math.sqrt(this.RecentRMS16000); this.RecentLevelValue16000= Math.sqrt(this.RecentRMS16000);
this.LevelValues.push(this.RecentLevelValue);
this.LevelValues65.push(this.RecentLevelValue65) ;
this.LevelValues125.push(this.RecentLevelValue125);
this.LevelValues250.push(this.RecentLevelValue250);
this.LevelValues500.push(this.RecentLevelValue500);
this.LevelValues1000.push(this.RecentLevelValue1000);
this.LevelValues2000.push(this.RecentLevelValue2000);
this.LevelValues4000.push(this.RecentLevelValue4000);
this.LevelValues8000.push(this.RecentLevelValue8000);
this.LevelValues16000.push(this.RecentLevelValue16000);
if (this.timeHeight > 40){ if (this.timeHeight > 40){
this.LevelValues.shift(); this.LevelValues.shift();
this.LevelValues65.shift(); this.LevelValues65.shift();
@ -619,6 +611,22 @@ export default {
this.LevelValues4000.shift(); this.LevelValues4000.shift();
this.LevelValues8000.shift(); this.LevelValues8000.shift();
this.LevelValues16000.shift(); this.LevelValues16000.shift();
}
this.LevelValues.push(this.RecentLevelValue);
this.LevelValues65.push(this.RecentLevelValue65) ;
this.LevelValues125.push(this.RecentLevelValue125);
this.LevelValues250.push(this.RecentLevelValue250);
this.LevelValues500.push(this.RecentLevelValue500);
this.LevelValues1000.push(this.RecentLevelValue1000);
this.LevelValues2000.push(this.RecentLevelValue2000);
this.LevelValues4000.push(this.RecentLevelValue4000);
this.LevelValues8000.push(this.RecentLevelValue8000);
this.LevelValues16000.push(this.RecentLevelValue16000);
if(this.timeHeight > 50){
// this.stopmeasurement();
} }
// console.log('Level 65',this.LevelValues65.length) // console.log('Level 65',this.LevelValues65.length)
@ -678,7 +686,7 @@ export default {
//set up the different audio nodes we will use for the app //set up the different audio nodes we will use for the app
this.Gain = this.audioCtx.createGain(); this.Gain = this.audioCtx.createGain();
this.Gain.gain.setValueAtTime(2.0, this.audioCtx.currentTime); this.Gain.gain.setValueAtTime(1.0, this.audioCtx.currentTime);
// this.Gain.gain.setValueAtTime(0.5,0); // this.Gain.gain.setValueAtTime(0.5,0);
this.HPF = this.audioCtx.createBiquadFilter(); this.HPF = this.audioCtx.createBiquadFilter();
@ -864,8 +872,9 @@ export default {
// this.bandPass16000.connect(this.audioCtx.destination);
// this.source.connect(this.bandPass1); // this.source.connect(this.bandPass1);
// this.bandPass1.connect(this.audioCtx.destination); // this.source.connect(this.audioCtx.destination);
// this.LevelAnalyser.connect(this.audioCtx.destination); // this.LevelAnalyser.connect(this.audioCtx.destination);
this.FirstStart = false; this.FirstStart = false;