speaker-calibration 2.2.264 → 2.2.265
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/dist/example/i18n.js +8442 -8248
- package/dist/listener.js +1 -1
- package/dist/main.js +2 -2
- package/dist/phonePeer.js +1 -1
- package/package.json +1 -1
- package/src/peer-connection/speaker.js +2 -2
- package/src/tasks/combination/combination.js +24 -16
package/package.json
CHANGED
|
@@ -622,7 +622,7 @@ class Speaker extends AudioPeer {
|
|
|
622
622
|
// p.style.fontWeight = 'normal';
|
|
623
623
|
// p.style.paddingTop = '20px';
|
|
624
624
|
// const timeToCalibrateText = phrases.RC_howLongToCalibrate['en-US'];
|
|
625
|
-
// p.innerHTML = timeToCalibrateText.replace('
|
|
625
|
+
// p.innerHTML = timeToCalibrateText.replace('[[N11]]', this.timeToCalibrate);
|
|
626
626
|
// instructionDisplay.appendChild(p);
|
|
627
627
|
}
|
|
628
628
|
|
|
@@ -630,7 +630,7 @@ class Speaker extends AudioPeer {
|
|
|
630
630
|
if (timeToCalibrateDisplay) {
|
|
631
631
|
const timeToCalibrateText = this.phrases.RC_howLongToCalibrate[this.language];
|
|
632
632
|
timeToCalibrateDisplay.innerHTML = timeToCalibrateText.replace(
|
|
633
|
-
'[[
|
|
633
|
+
'[[N11]]',
|
|
634
634
|
this.timeToCalibrate
|
|
635
635
|
);
|
|
636
636
|
timeToCalibrateDisplay.style.fontWeight = 'normal';
|
|
@@ -375,9 +375,9 @@ class Combination extends AudioCalibrator {
|
|
|
375
375
|
: '';
|
|
376
376
|
|
|
377
377
|
const samplingParamText = this.phrases.RC_SamplingHzBits[this.language]
|
|
378
|
-
.replace('[[
|
|
379
|
-
.replace('[[
|
|
380
|
-
.replace('[[
|
|
378
|
+
.replace('[[N11]]', this.sourceSamplingRate)
|
|
379
|
+
.replace('[[N22]]', this.sinkSamplingRate)
|
|
380
|
+
.replace('[[N33]]', this.calibrateSoundSamplingDesiredBits);
|
|
381
381
|
const reportParameters = `${simulateText}${samplingParamText} ↓${this._calibrateSoundBurstDownsample}:1`;
|
|
382
382
|
if (this.flags) {
|
|
383
383
|
flags = `<br> autoGainControl: ${this.flags.autoGainControl}, echoCancellation: ${this.flags.echoCancellation}, noiseSuppression: ${this.flags.noiseSuppression}`;
|
|
@@ -843,12 +843,14 @@ class Combination extends AudioCalibrator {
|
|
|
843
843
|
}
|
|
844
844
|
this.recordingChecks['unfiltered'].push(result);
|
|
845
845
|
console.log('start calculate impulse response');
|
|
846
|
-
const usedPeriodStart = this._calibrateSoundBurstPreSec * this.sourceSamplingRate;
|
|
846
|
+
// const usedPeriodStart = this._calibrateSoundBurstPreSec * this.sourceSamplingRate;
|
|
847
|
+
const usedPeriodStart = this.num_mls_to_skip * this.sourceSamplingRate;
|
|
847
848
|
const usedPeriodEnd =
|
|
848
849
|
(this._calibrateSoundBurstPreSec +
|
|
849
850
|
this._calibrateSoundBurstRepeats * this._calibrateSoundBurstSec) *
|
|
850
851
|
this.sourceSamplingRate;
|
|
851
|
-
const payload_skipped_warmUp = payload.slice(usedPeriodStart, usedPeriodEnd);
|
|
852
|
+
// const payload_skipped_warmUp = payload.slice(usedPeriodStart, usedPeriodEnd);
|
|
853
|
+
const payload_skipped_warmUp = payload.slice(usedPeriodStart);
|
|
852
854
|
|
|
853
855
|
console.log('payload.length', payload.length);
|
|
854
856
|
console.log('usedPeriodStart', usedPeriodStart);
|
|
@@ -1075,11 +1077,12 @@ class Combination extends AudioCalibrator {
|
|
|
1075
1077
|
* @example
|
|
1076
1078
|
*/
|
|
1077
1079
|
#createCalibrationNodeFromBuffer = dataBuffer => {
|
|
1078
|
-
const mlsSignal =
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1080
|
+
const mlsSignal = dataBuffer;
|
|
1081
|
+
// reorderMLS(
|
|
1082
|
+
// dataBuffer,
|
|
1083
|
+
// this.calibrateSound1000HzPreSec,
|
|
1084
|
+
// this.sourceSamplingRate
|
|
1085
|
+
// );
|
|
1083
1086
|
console.log('length databuffer');
|
|
1084
1087
|
console.log(mlsSignal.length);
|
|
1085
1088
|
if (!this.sourceAudioContext) {
|
|
@@ -2396,11 +2399,12 @@ class Combination extends AudioCalibrator {
|
|
|
2396
2399
|
// Followed by two whole MLS. Followed by the initial 1 sec of MLS. Again, all the pieces together
|
|
2397
2400
|
// should be one contiguous piece cut out from an infinitely repeating MLS.
|
|
2398
2401
|
// Get the MLS signal for this capture
|
|
2399
|
-
const mlsSignal =
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2402
|
+
const mlsSignal = this.#mlsBufferView[this.icapture];
|
|
2403
|
+
// reorderMLS(
|
|
2404
|
+
// this.#mlsBufferView[this.icapture],
|
|
2405
|
+
// this.calibrateSound1000HzPreSec,
|
|
2406
|
+
// this.sourceSamplingRate
|
|
2407
|
+
// );
|
|
2404
2408
|
|
|
2405
2409
|
// Run the simulation
|
|
2406
2410
|
await this.simulatedMLSCalibration(
|
|
@@ -3438,7 +3442,11 @@ class Combination extends AudioCalibrator {
|
|
|
3438
3442
|
);
|
|
3439
3443
|
console.log('this.recordingChecks: ', this.recordingChecks);
|
|
3440
3444
|
console.log('this.soundCheck: ', this.soundCheck);
|
|
3441
|
-
this.recordingChecks[this.soundCheck]
|
|
3445
|
+
if (this.recordingChecks[this.soundCheck]) {
|
|
3446
|
+
this.recordingChecks[this.soundCheck].push(result);
|
|
3447
|
+
} else {
|
|
3448
|
+
this.recordingChecks[this.soundCheck] = [result];
|
|
3449
|
+
}
|
|
3442
3450
|
// Now we do at most 2 attempts if sd > _calibrateSoundBurstMaxSD_dB
|
|
3443
3451
|
// Second attempt is the final
|
|
3444
3452
|
if (this.numSuccessfulCaptured < 2) {
|