speaker-calibration 2.2.186 → 2.2.188

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.186",
3
+ "version": "2.2.188",
4
4
  "description": "Speaker calibration library for auditory testing",
5
5
  "main": "dist/main.js",
6
6
  "directories": {
@@ -198,7 +198,9 @@ class Speaker extends AudioPeer {
198
198
  params.IDsToSaveInSoundProfileLibrary,
199
199
  params.restartButton,
200
200
  params.reminder,
201
- params.calibrateSoundLimit
201
+ params.calibrateSoundLimit,
202
+ params.calibrateSoundBurstNormalizeBy1000HzGainBool,
203
+ params.calibrateSoundBurstScalarDB
202
204
  );
203
205
  speaker.#removeUIElems();
204
206
  resolve(speaker.result);
@@ -696,7 +698,9 @@ class Speaker extends AudioPeer {
696
698
  params.IDsToSaveInSoundProfileLibrary,
697
699
  params.restartButton,
698
700
  params.reminder,
699
- params.calibrateSoundLimit
701
+ params.calibrateSoundLimit,
702
+ params.calibrateSoundBurstNormalizeBy1000HzGainBool,
703
+ params.calibrateSoundBurstScalarDB
700
704
  );
701
705
  this.#removeUIElems();
702
706
  resolve(result);
@@ -436,8 +436,18 @@ class Combination extends AudioCalibrator {
436
436
  const filteredComputedIRs = computedIRs.filter(element => {
437
437
  return element != undefined;
438
438
  });
439
- const componentIRGains = this.componentIR['Gain'];
439
+ let componentIRGains = this.componentIR['Gain'];
440
440
  const componentIRFreqs = this.componentIR['Freq'];
441
+ //normalize the component IR gains
442
+ componentIRGains = componentIRGains.map(value => {
443
+ return value + this._calibrateSoundBurstScalarDB - this._calibrateSoundBurstDb;
444
+ });
445
+ if (this._calibrateSoundBurstNormalizeBy1000HzGainBool) {
446
+ const sineGainAt1000Hz_dB = this.gainDBSPL;
447
+ componentIRGains = componentIRGains.map(value => {
448
+ return value - sineGainAt1000Hz_dB;
449
+ });
450
+ }
441
451
  const mls = this.#mls[this.icapture];
442
452
  const lowHz = this.#lowHz;
443
453
  const iirLength = this.iirLength;
@@ -2704,7 +2714,9 @@ class Combination extends AudioCalibrator {
2704
2714
  userIDs,
2705
2715
  restartButton,
2706
2716
  reminder,
2707
- calibrateSoundLimit
2717
+ calibrateSoundLimit,
2718
+ _calibrateSoundBurstNormalizeBy1000HzGainBool,
2719
+ _calibrateSoundBurstScalarDB
2708
2720
  ) => {
2709
2721
  this.TAPER_SECS = _calibrateSoundTaperSec;
2710
2722
  this.calibrateSoundLimit = calibrateSoundLimit;
@@ -2730,6 +2742,9 @@ class Combination extends AudioCalibrator {
2730
2742
  this._calibrateSoundPowerBinDesiredSec = _calibrateSoundPowerBinDesiredSec;
2731
2743
  this._calibrateSoundBurstUses1000HzGainBool = _calibrateSoundBurstUses1000HzGainBool;
2732
2744
  this._calibrateSoundPowerDbSDToleratedDb = _calibrateSoundPowerDbSDToleratedDb;
2745
+ this._calibrateSoundBurstNormalizeBy1000HzGainBool =
2746
+ _calibrateSoundBurstNormalizeBy1000HzGainBool;
2747
+ this._calibrateSoundBurstScalarDB = _calibrateSoundBurstScalarDB;
2733
2748
  this.webAudioDeviceNames = webAudioDeviceNames;
2734
2749
  if (isSmartPhone) this.webAudioDeviceNames.microphone = this.deviceInfo.microphoneFromAPI;
2735
2750
  this.webAudioDeviceNames.microphoneText = this.webAudioDeviceNames.microphoneText