speaker-calibration 2.2.193 → 2.2.194

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.193",
3
+ "version": "2.2.194",
4
4
  "description": "Speaker calibration library for auditory testing",
5
5
  "main": "dist/main.js",
6
6
  "directories": {
@@ -55,6 +55,7 @@ class AudioCalibrator extends AudioRecorder {
55
55
  /** @private */
56
56
  startTime;
57
57
 
58
+ numCalibratingRoundsCompleted=0;
58
59
  /**
59
60
  * Called when a call is received.
60
61
  * Creates a local audio DOM element and attaches it to the page.
@@ -240,6 +240,7 @@ class Combination extends AudioCalibrator {
240
240
  unfiltered: [],
241
241
  system: [],
242
242
  component: [],
243
+ warnings:[]
243
244
  };
244
245
 
245
246
  inDB;
@@ -604,6 +605,10 @@ class Combination extends AudioCalibrator {
604
605
  console.log('SD: ' + result['sd'] + ', less than _calibrateSoundBurstMaxSD_dB: ' + this._calibrateSoundBurstMaxSD_dB);
605
606
  } else {
606
607
  console.log('SD: ' + result['sd'] + ', greater than _calibrateSoundBurstMaxSD_dB: ' + this._calibrateSoundBurstMaxSD_dB);
608
+ this.recordingChecks['warnings'].push(`Redo all Hz recording because SD ${result['sd']} dB> ${this._calibrateSoundBurstMaxSD_dB} dB`);
609
+ this.status =
610
+ `Redoing all Hz recording because SD ${result['sd']} dB> ${this._calibrateSoundBurstMaxSD_dB} dB`.toString() +
611
+ this.generateTemplate().toString();
607
612
  }
608
613
  if (this.numSuccessfulCaptured == 1) {
609
614
  console.log('pop last unfiltered mls volume check');
@@ -2246,6 +2251,12 @@ class Combination extends AudioCalibrator {
2246
2251
  };
2247
2252
 
2248
2253
  #playCalibrationAudioVolume = async () => {
2254
+ if (this.numCalibratingRoundsCompleted==1) {
2255
+ this.recordingChecks['warnings'].push(`Redo 1000 Hz, ${this.inDB} dB, recording because SD ${this.recordingChecks['volume'][this.inDB]['sd']} dB> ${this.calibrateSound1000HzMaxSD_dB} dB`);
2256
+ this.status =
2257
+ `Redoing 1000 Hz recording because SD ${this.recordingChecks['volume'][this.inDB]} dB> ${this.calibrateSound1000HzMaxSD_dB} dB`.toString() +
2258
+ this.generateTemplate().toString();
2259
+ }
2249
2260
  const totalDuration = this.CALIBRATION_TONE_DURATION * 1.2;
2250
2261
 
2251
2262
  this.calibrationNodes[0].start(0);
@@ -2341,6 +2352,7 @@ class Combination extends AudioCalibrator {
2341
2352
  //reset the values
2342
2353
  //this.incrementStatusBar();
2343
2354
 
2355
+ console.log(this.recordingChecks['warnings']);
2344
2356
  this.outDBSPL = null;
2345
2357
  this.outDBSPL = null;
2346
2358
  this.outDBSPL1000 = null;
@@ -2647,6 +2659,10 @@ class Combination extends AudioCalibrator {
2647
2659
  if (result) {
2648
2660
  if (result['sd'] > this._calibrateSoundBurstMaxSD_dB & this.numSuccessfulCaptured) {
2649
2661
  console.log('filtered recording sd too high');
2662
+ this.recordingChecks['warnings'].push(`Redo all Hz recording because SD ${result['sd']} dB> ${this._calibrateSoundBurstMaxSD_dB} dB`);
2663
+ this.status =
2664
+ `Redoing all Hz recording because SD ${result['sd']} dB> ${this._calibrateSoundBurstMaxSD_dB} dB`.toString() +
2665
+ this.generateTemplate().toString();
2650
2666
  // numSuccessfulCaptured no longer to count number of successful capture but count attemps
2651
2667
  // is sd below _calibrateSoundBurstMaxSD_dB then count two attemps
2652
2668
  // else count one attemp