speaker-calibration 2.2.259 → 2.2.261
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 +15292 -14725
- package/dist/listener.js +1 -1
- package/dist/main.js +1 -1
- package/dist/phonePeer.js +1 -1
- package/package.json +1 -1
- package/src/tasks/combination/combination.js +11 -11
package/package.json
CHANGED
|
@@ -844,7 +844,7 @@ class Combination extends AudioCalibrator {
|
|
|
844
844
|
this.recordingChecks['unfiltered'].push(result);
|
|
845
845
|
console.log('start calculate impulse response');
|
|
846
846
|
const usedPeriodStart = this._calibrateSoundBurstPreSec * this.sourceSamplingRate;
|
|
847
|
-
const usedPeriodEnd = (this._calibrateSoundBurstPreSec + this._calibrateSoundBurstRepeats * this.
|
|
847
|
+
const usedPeriodEnd = (this._calibrateSoundBurstPreSec + this._calibrateSoundBurstRepeats * this._calibrateSoundBurstSec) * this.sourceSamplingRate;
|
|
848
848
|
const payload_skipped_warmUp = payload.slice(usedPeriodStart, usedPeriodEnd);
|
|
849
849
|
|
|
850
850
|
console.log('payload.length', payload.length);
|
|
@@ -1292,7 +1292,7 @@ class Combination extends AudioCalibrator {
|
|
|
1292
1292
|
);
|
|
1293
1293
|
this.filteredMLSRange.system.Min = findMinValue(this.#currentConvolution);
|
|
1294
1294
|
this.filteredMLSRange.system.Max = findMaxValue(this.#currentConvolution);
|
|
1295
|
-
this.soundCheck = '
|
|
1295
|
+
this.soundCheck = 'speakerAndMic';
|
|
1296
1296
|
|
|
1297
1297
|
if (this.isCalibrating) return null;
|
|
1298
1298
|
|
|
@@ -1681,7 +1681,7 @@ class Combination extends AudioCalibrator {
|
|
|
1681
1681
|
this.calibrateSoundSimulateMicrophone !== null &&
|
|
1682
1682
|
this.calibrateSoundSimulateLoudspeaker !== null;
|
|
1683
1683
|
|
|
1684
|
-
if (this._calibrateSoundCheck != '
|
|
1684
|
+
if (this._calibrateSoundCheck != 'speakerAndMic') {
|
|
1685
1685
|
this.#currentConvolution = this.componentConvolution;
|
|
1686
1686
|
this.#currentConvolution = this.upsampleSignal(
|
|
1687
1687
|
this.#currentConvolution,
|
|
@@ -1713,7 +1713,7 @@ class Combination extends AudioCalibrator {
|
|
|
1713
1713
|
);
|
|
1714
1714
|
this.filteredMLSRange.system.Min = findMinValue(this.#currentConvolution);
|
|
1715
1715
|
this.filteredMLSRange.system.Max = findMaxValue(this.#currentConvolution);
|
|
1716
|
-
this.soundCheck = '
|
|
1716
|
+
this.soundCheck = 'speakerAndMic';
|
|
1717
1717
|
|
|
1718
1718
|
if (this.isCalibrating) return null;
|
|
1719
1719
|
|
|
@@ -1732,14 +1732,14 @@ class Combination extends AudioCalibrator {
|
|
|
1732
1732
|
}
|
|
1733
1733
|
|
|
1734
1734
|
let conv_recs = this.getAllFilteredRecordedSignals();
|
|
1735
|
-
if (this._calibrateSoundCheck == '
|
|
1735
|
+
if (this._calibrateSoundCheck == 'speakerOrMic') {
|
|
1736
1736
|
if (this.componentAttentuatorGainDB != 0) {
|
|
1737
1737
|
let linearScaleAttenuation = Math.pow(10, this.componentAttenuatorGainDB / 20);
|
|
1738
1738
|
conv_recs = conv_recs.map(rec => {
|
|
1739
1739
|
return rec.map(value => value / this.linearScaleAttenuation);
|
|
1740
1740
|
});
|
|
1741
1741
|
}
|
|
1742
|
-
} else if (this._calibrateSoundCheck == '
|
|
1742
|
+
} else if (this._calibrateSoundCheck == 'speakerAndMic') {
|
|
1743
1743
|
if (this.systemAttentuatorGainDB != 0) {
|
|
1744
1744
|
let linearScaleAttenuation = Math.pow(10, this.systemAttenuatorGainDB / 20);
|
|
1745
1745
|
conv_recs = conv_recs.map(rec => {
|
|
@@ -1749,14 +1749,14 @@ class Combination extends AudioCalibrator {
|
|
|
1749
1749
|
}
|
|
1750
1750
|
|
|
1751
1751
|
let recs = this.getAllUnfilteredRecordedSignals();
|
|
1752
|
-
if (this._calibrateSoundCheck == '
|
|
1752
|
+
if (this._calibrateSoundCheck == 'speakerOrMic') {
|
|
1753
1753
|
if (this.componentAttentuatorGainDB != 0) {
|
|
1754
1754
|
let linearScaleAttenuation = Math.pow(10, this.componentAttenuatorGainDB / 20);
|
|
1755
1755
|
recs = recs.map(rec => {
|
|
1756
1756
|
return rec.map(value => value / this.linearScaleAttenuation);
|
|
1757
1757
|
});
|
|
1758
1758
|
}
|
|
1759
|
-
} else if (this._calibrateSoundCheck == '
|
|
1759
|
+
} else if (this._calibrateSoundCheck == 'speakerAndMic') {
|
|
1760
1760
|
if (this.systemAttentuatorGainDB != 0) {
|
|
1761
1761
|
let linearScaleAttenuation = Math.pow(10, this.systemAttentuatorGainDB / 20);
|
|
1762
1762
|
recs = recs.map(rec => {
|
|
@@ -1780,7 +1780,7 @@ class Combination extends AudioCalibrator {
|
|
|
1780
1780
|
this.sourceAudioContext.close();
|
|
1781
1781
|
}
|
|
1782
1782
|
|
|
1783
|
-
if (this._calibrateSoundCheck != '
|
|
1783
|
+
if (this._calibrateSoundCheck != 'speakerAndMic') {
|
|
1784
1784
|
let knownGain = this.oldComponentIR.Gain;
|
|
1785
1785
|
let knownFreq = this.oldComponentIR.Freq;
|
|
1786
1786
|
let sampleRate = this.sourceSamplingRate || 96000;
|
|
@@ -2435,7 +2435,7 @@ class Combination extends AudioCalibrator {
|
|
|
2435
2435
|
let iir_ir_and_plots;
|
|
2436
2436
|
if (this._calibrateSoundCheck != 'none') {
|
|
2437
2437
|
//do single check
|
|
2438
|
-
if (this._calibrateSoundCheck == '
|
|
2438
|
+
if (this._calibrateSoundCheck == 'speakerOrMic' || this._calibrateSoundCheck == 'speakerAndMic') {
|
|
2439
2439
|
if (this.isCalibrating) return null;
|
|
2440
2440
|
iir_ir_and_plots = await this.singleSoundCheck(stream);
|
|
2441
2441
|
if (this.isCalibrating) return null;
|
|
@@ -3441,7 +3441,7 @@ class Combination extends AudioCalibrator {
|
|
|
3441
3441
|
lCalib = 104.92978421490648,
|
|
3442
3442
|
componentIR = null,
|
|
3443
3443
|
microphoneName = 'MiniDSP-UMIK1-711-4754-vertical',
|
|
3444
|
-
_calibrateSoundCheck = '
|
|
3444
|
+
_calibrateSoundCheck = 'speakerOrMic', //GOAL PASSed in by default
|
|
3445
3445
|
isSmartPhone = false,
|
|
3446
3446
|
_calibrateSoundBurstDb = -18,
|
|
3447
3447
|
_calibrateSoundBurstFilteredExtraDb = 6,
|