speaker-calibration 2.2.244 → 2.2.245

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.244",
3
+ "version": "2.2.245",
4
4
  "description": "Speaker calibration library for auditory testing",
5
5
  "main": "dist/main.js",
6
6
  "directories": {
@@ -172,9 +172,7 @@ class Speaker extends AudioPeer {
172
172
  speaker.connectionManager.send({
173
173
  name: 'SoundCalibration',
174
174
  message: 'phrases',
175
- payload: {
176
- phrases: speaker.phrases,
177
- },
175
+ payload: speaker.phrases,
178
176
  });
179
177
 
180
178
  // Send connection parameters to the listener
@@ -746,6 +746,9 @@ class Combination extends AudioCalibrator {
746
746
  const burst = this._calibrateSoundBurstSec;
747
747
  const post = this._calibrateSoundBurstPostSec;
748
748
  const total_dur = pre + repeats * burst + post;
749
+ const simulationEnabled =
750
+ this.calibrateSoundSimulateMicrophone !== null &&
751
+ this.calibrateSoundSimulateLoudspeaker !== null;
749
752
  await this.pyServerAPI
750
753
  .allHzPowerCheck({
751
754
  payload: payload_downsampled,
@@ -758,7 +761,11 @@ class Combination extends AudioCalibrator {
758
761
  })
759
762
  .then(async result => {
760
763
  if (result) {
761
- if (result['sd'] > this._calibrateSoundBurstMaxSD_dB && this.numSuccessfulCaptured == 0) {
764
+ if (
765
+ result['sd'] > this._calibrateSoundBurstMaxSD_dB &&
766
+ this.numSuccessfulCaptured == 0 &&
767
+ !simulationEnabled
768
+ ) {
762
769
  console.log(
763
770
  'SD: ' +
764
771
  result['sd'] +
@@ -834,7 +841,7 @@ class Combination extends AudioCalibrator {
834
841
  sampleRate: fMLS,
835
842
  numPeriods:
836
843
  (this.numMLSPerCapture - this.num_mls_to_skip) /
837
- this._calibrateSoundBurstDownsample,
844
+ (2 * this._calibrateSoundBurstDownsample),
838
845
  downsample: this._calibrateSoundBurstDownsample,
839
846
  })
840
847
  .then(async res => {
@@ -849,7 +856,7 @@ class Combination extends AudioCalibrator {
849
856
  sampleRate: fMLS,
850
857
  numPeriods:
851
858
  (this.numMLSPerCapture - this.num_mls_to_skip) /
852
- this._calibrateSoundBurstDownsample,
859
+ (2 * this._calibrateSoundBurstDownsample),
853
860
  sig: payload_skipped_warmUp_downsampled,
854
861
  fs2: this.fs2,
855
862
  L_new_n: this.L_new_n,
@@ -1188,12 +1195,11 @@ class Combination extends AudioCalibrator {
1188
1195
 
1189
1196
  // Save the simulated recording
1190
1197
  await this.saveFilteredRecording(simulatedRecording);
1198
+ this.numSuccessfulCaptured = 2; // Mark as successfully captured to avoid retries
1191
1199
 
1192
1200
  // Process the recording
1193
1201
  await this.checkPowerVariation();
1194
1202
 
1195
- this.numSuccessfulCaptured = 2; // Mark as successfully captured to avoid retries
1196
-
1197
1203
  this.stepNum += 1;
1198
1204
  this.incrementStatusBar();
1199
1205
  this.status = this.generateTemplate(