speaker-calibration 2.2.227 → 2.2.228

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.227",
3
+ "version": "2.2.228",
4
4
  "description": "Speaker calibration library for auditory testing",
5
5
  "main": "dist/main.js",
6
6
  "directories": {
@@ -439,14 +439,8 @@ class Combination extends AudioCalibrator {
439
439
  })
440
440
  .then(result => {
441
441
  console.log(result);
442
- this.systemConvolution = this.upsampleSignal(
443
- result['convolution'],
444
- this._calibrateSoundBurstDownsample
445
- );
446
- this.systemConvolutionNoBandpass = this.upsampleSignal(
447
- result['convolution_no_bandpass'],
448
- this._calibrateSoundBurstDownsample
449
- );
442
+ this.systemConvolution = result['convolution'];
443
+ this.systemConvolutionNoBandpass = result['convolution_no_bandpass'];
450
444
  });
451
445
 
452
446
  // attenuate the system convolution if the amplitude is greater than this.calibrateSoundLimit
@@ -679,7 +673,10 @@ class Combination extends AudioCalibrator {
679
673
  'Obtaining last all hz unfiltered recording from #allHzUnfilteredRecordings to send to server for processing'
680
674
  );
681
675
  const numSignals = allSignals.length;
682
- const mls = this.#mlsBufferView[this.icapture];
676
+ const mls = this.downsampleSignal(
677
+ this.#mlsBufferView[this.icapture],
678
+ this._calibrateSoundBurstDownsample
679
+ );
683
680
  const payload =
684
681
  signalCsv && signalCsv.length > 0 ? csvToArray(signalCsv) : allSignals[numSignals - 1];
685
682
  console.log('sending rec');
@@ -691,9 +688,10 @@ class Combination extends AudioCalibrator {
691
688
  this.emit('update', {message: this.status});
692
689
  if (this.isCalibrating) return null;
693
690
  const fMLS = this.sourceSamplingRate / this._calibrateSoundBurstDownsample;
691
+ const payload_downsampled = this.downsampleSignal(payload, this._calibrateSoundBurstDownsample);
694
692
  await this.pyServerAPI
695
693
  .allHzPowerCheck({
696
- payload,
694
+ payload: payload_downsampled,
697
695
  sampleRate: fMLS,
698
696
  binDesiredSec: this._calibrateSoundPowerBinDesiredSec,
699
697
  burstSec: this.desired_time_per_mls,
@@ -1103,6 +1101,10 @@ class Combination extends AudioCalibrator {
1103
1101
  bothSoundCheck = async stream => {
1104
1102
  let iir_ir_and_plots;
1105
1103
  this.#currentConvolution = this.componentConvolution;
1104
+ this.#currentConvolution = this.upsampleSignal(
1105
+ this.#currentConvolution,
1106
+ this._calibrateSoundBurstDownsample
1107
+ );
1106
1108
  this.filteredMLSRange.component.Min = findMinValue(this.#currentConvolution);
1107
1109
  this.filteredMLSRange.component.Max = findMaxValue(this.#currentConvolution);
1108
1110
  const pre = this._calibrateSoundBurstPreSec;
@@ -1130,6 +1132,10 @@ class Combination extends AudioCalibrator {
1130
1132
 
1131
1133
  this.numSuccessfulCaptured = 0;
1132
1134
  this.#currentConvolution = this.systemConvolution;
1135
+ this.#currentConvolution = this.upsampleSignal(
1136
+ this.#currentConvolution,
1137
+ this._calibrateSoundBurstDownsample
1138
+ );
1133
1139
  this.filteredMLSRange.system.Min = findMinValue(this.#currentConvolution);
1134
1140
  this.filteredMLSRange.system.Max = findMaxValue(this.#currentConvolution);
1135
1141
  this.soundCheck = 'system';
@@ -1516,6 +1522,10 @@ class Combination extends AudioCalibrator {
1516
1522
  const total_dur = pre + repeats * burst + post;
1517
1523
  if (this._calibrateSoundCheck != 'system') {
1518
1524
  this.#currentConvolution = this.componentConvolution;
1525
+ this.#currentConvolution = this.upsampleSignal(
1526
+ this.#currentConvolution,
1527
+ this._calibrateSoundBurstDownsample
1528
+ );
1519
1529
  this.filteredMLSRange.component.Min = findMinValue(this.#currentConvolution);
1520
1530
  this.filteredMLSRange.component.Max = findMaxValue(this.#currentConvolution);
1521
1531
  this.soundCheck = 'component';
@@ -1526,6 +1536,10 @@ class Combination extends AudioCalibrator {
1526
1536
  this.stopCalibrationAudio();
1527
1537
  } else {
1528
1538
  this.#currentConvolution = this.systemConvolution;
1539
+ this.#currentConvolution = this.upsampleSignal(
1540
+ this.#currentConvolution,
1541
+ this._calibrateSoundBurstDownsample
1542
+ );
1529
1543
  this.filteredMLSRange.system.Min = findMinValue(this.#currentConvolution);
1530
1544
  this.filteredMLSRange.system.Max = findMaxValue(this.#currentConvolution);
1531
1545
  this.soundCheck = 'system';