speaker-calibration 2.2.180 → 2.2.182

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speaker-calibration",
3
- "version": "2.2.180",
3
+ "version": "2.2.182",
4
4
  "description": "Speaker calibration library for auditory testing",
5
5
  "main": "dist/main.js",
6
6
  "directories": {
@@ -191,6 +191,7 @@ class Speaker extends AudioPeer {
191
191
  params.calibrateSound1000HzPostSec,
192
192
  params.calibrateSoundBackgroundSecs,
193
193
  params.calibrateSoundSmoothOctaves,
194
+ params.calibrateSoundSmoothMinBandwidthHz,
194
195
  params.calibrateSoundPowerBinDesiredSec,
195
196
  params.calibrateSoundPowerDbSDToleratedDb,
196
197
  params.calibrateSoundTaperSec,
@@ -388,7 +389,7 @@ await fetch(url, options)
388
389
  const proceedButton = document.createElement('button');
389
390
  proceedButton.setAttribute('id', 'calibrationProceedButton');
390
391
  proceedButton.setAttribute('class', 'btn btn-success');
391
- proceedButton.innerHTML = 'Proceed';
392
+ proceedButton.innerHTML = phrases.T_PROCEED[this.language];
392
393
  proceedButton.onclick = () => {
393
394
  // open the link in a new tab
394
395
  window.open(this.uri, '_blank');
@@ -692,6 +693,7 @@ await fetch(url, options)
692
693
  params.calibrateSound1000HzPostSec,
693
694
  params.calibrateSoundBackgroundSecs,
694
695
  params.calibrateSoundSmoothOctaves,
696
+ params.calibrateSoundSmoothMinBandwidthHz,
695
697
  params.calibrateSoundPowerBinDesiredSec,
696
698
  params.calibrateSoundPowerDbSDToleratedDb,
697
699
  params.calibrateSoundTaperSec,
@@ -426,6 +426,7 @@ class PythonServerAPI {
426
426
  mlsAmplitude,
427
427
  irLength,
428
428
  calibrateSoundSmoothOctaves,
429
+ calibrateSoundSmoothMinBandwidthHz,
429
430
  calibrateSoundBurstFilteredExtraDb,
430
431
  calibrateSoundIIRPhase
431
432
  }) => {
@@ -447,6 +448,7 @@ class PythonServerAPI {
447
448
  mlsAmplitude,
448
449
  irLength,
449
450
  calibrateSoundSmoothOctaves,
451
+ calibrateSoundSmoothMinBandwidthHz,
450
452
  calibrateSoundBurstFilteredExtraDb,
451
453
  calibrateSoundIIRPhase
452
454
  });
@@ -583,6 +585,7 @@ class PythonServerAPI {
583
585
  mlsAmplitude,
584
586
  irLength,
585
587
  calibrateSoundSmoothOctaves,
588
+ calibrateSoundSmoothMinBandwidthHz,
586
589
  calibrateSoundBurstFilteredExtraDb,
587
590
  calibrateSoundIIRPhase
588
591
  }) => {
@@ -603,6 +606,7 @@ class PythonServerAPI {
603
606
  mlsAmplitude,
604
607
  irLength,
605
608
  calibrateSoundSmoothOctaves,
609
+ calibrateSoundSmoothMinBandwidthHz,
606
610
  calibrateSoundBurstFilteredExtraDb,
607
611
  calibrateSoundIIRPhase
608
612
  });
@@ -461,6 +461,7 @@ class Combination extends AudioCalibrator {
461
461
  mlsAmplitude: Math.pow(10, this.power_dB / 20),
462
462
  irLength,
463
463
  calibrateSoundSmoothOctaves: this._calibrateSoundSmoothOctaves,
464
+ calibrateSoundSmoothMinBandwidthHz: this._calibrateSoundSmoothMinBandwidthHz,
464
465
  calibrateSoundBurstFilteredExtraDb: this._calibrateSoundBurstFilteredExtraDb,
465
466
  calibrateSoundIIRPhase: this.calibrateSoundIIRPhase
466
467
  })
@@ -2452,7 +2453,11 @@ class Combination extends AudioCalibrator {
2452
2453
  const querySnapshot = await getDocs(q);
2453
2454
  // if exists return the linear field of the first document
2454
2455
  if (querySnapshot.size > 0) {
2455
- return querySnapshot.docs[0].data().linear;
2456
+ return {
2457
+ ir: querySnapshot.docs[0].data().linear,
2458
+ createDate: querySnapshot.docs[0].data().createDate,
2459
+ jsonFileName: querySnapshot.docs[0].data().jsonFileName
2460
+ };
2456
2461
  }
2457
2462
  return null;
2458
2463
  };
@@ -2676,6 +2681,7 @@ class Combination extends AudioCalibrator {
2676
2681
  calibrateSound1000HzPostSec = 0.5,
2677
2682
  _calibrateSoundBackgroundSecs = 0,
2678
2683
  _calibrateSoundSmoothOctaves = 0.33,
2684
+ _calibrateSoundSmoothMinBandwidthHz = 200,
2679
2685
  _calibrateSoundPowerBinDesiredSec = 0.2,
2680
2686
  _calibrateSoundPowerDbSDToleratedDb = 1,
2681
2687
  _calibrateSoundTaperSec = 0.01,
@@ -2693,7 +2699,7 @@ class Combination extends AudioCalibrator {
2693
2699
  userIDs,
2694
2700
  restartButton,
2695
2701
  reminder,
2696
- calibrateSoundLimit,
2702
+ calibrateSoundLimit
2697
2703
  ) => {
2698
2704
  this.TAPER_SECS = _calibrateSoundTaperSec;
2699
2705
  this.calibrateSoundLimit = calibrateSoundLimit;
@@ -2715,6 +2721,7 @@ class Combination extends AudioCalibrator {
2715
2721
  this.desired_sampling_rate = _calibrateSoundHz;
2716
2722
  this._calibrateSoundBackgroundSecs = _calibrateSoundBackgroundSecs;
2717
2723
  this._calibrateSoundSmoothOctaves = _calibrateSoundSmoothOctaves;
2724
+ this._calibrateSoundSmoothMinBandwidthHz = _calibrateSoundSmoothMinBandwidthHz;
2718
2725
  this._calibrateSoundPowerBinDesiredSec = _calibrateSoundPowerBinDesiredSec;
2719
2726
  this._calibrateSoundBurstUses1000HzGainBool = _calibrateSoundBurstUses1000HzGainBool;
2720
2727
  this._calibrateSoundPowerDbSDToleratedDb = _calibrateSoundPowerDbSDToleratedDb;
@@ -2736,8 +2743,8 @@ class Combination extends AudioCalibrator {
2736
2743
  ? 'minidsp'
2737
2744
  : this.deviceInfo.OEM.toLowerCase().split(' ').join('')
2738
2745
  : micManufacturer.toLowerCase().split(' ').join('');
2739
- // const ID = "712-5669";
2740
- // const OEM = "minidsp";
2746
+ // const ID = "A2484";
2747
+ // const OEM = "apple";
2741
2748
  const micInfo = {
2742
2749
  micModelName: isSmartPhone ? micModelName : microphoneName,
2743
2750
  OEM: isSmartPhone
@@ -2780,9 +2787,14 @@ class Combination extends AudioCalibrator {
2780
2787
  if (componentIR == null) {
2781
2788
  //mode 'ir'
2782
2789
  //global variable this.componentIR must be set
2783
- this.componentIR = await this.readFrqGainFromFirestore(ID, OEM, true).then(data => {
2784
- return data;
2790
+ await this.readFrqGainFromFirestore(ID, OEM, true).then(data => {
2791
+ if (data !== null) {
2792
+ this.componentIR = data.ir;
2793
+ micInfo['parentTimestamp'] = data.createDate ? data.createDate : new Date();
2794
+ micInfo['parentFilenameJSON'] = data.jsonFileName ? data.jsonFileName : '';
2795
+ }
2785
2796
  });
2797
+
2786
2798
  // await this.readFrqGain(ID, OEM).then(data => {
2787
2799
  // return data;
2788
2800
  // });