speaker-calibration 2.2.245 → 2.2.246
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 +1917 -1832
- 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/server/PythonServerAPI.js +6 -1
- package/src/tasks/combination/combination.js +3 -6
package/package.json
CHANGED
|
@@ -843,7 +843,12 @@ class PythonServerAPI {
|
|
|
843
843
|
})
|
|
844
844
|
.then(response => {
|
|
845
845
|
res = response;
|
|
846
|
-
|
|
846
|
+
if (typeof res.data === 'string') {
|
|
847
|
+
//if there is NaN in the string, replace it with 0
|
|
848
|
+
res.data = res.data.replace('NaN', '0');
|
|
849
|
+
res.data = JSON.parse(res.data);
|
|
850
|
+
}
|
|
851
|
+
console.log('res', res);
|
|
847
852
|
})
|
|
848
853
|
.catch(error => {
|
|
849
854
|
throw error;
|
|
@@ -834,14 +834,13 @@ class Combination extends AudioCalibrator {
|
|
|
834
834
|
payload_skipped_warmUp,
|
|
835
835
|
this._calibrateSoundBurstDownsample
|
|
836
836
|
);
|
|
837
|
+
const factor = simulationEnabled ? this._calibrateSoundBurstDownsample : 1;
|
|
837
838
|
await this.pyServerAPI
|
|
838
839
|
.getAutocorrelation({
|
|
839
840
|
mls: mls,
|
|
840
841
|
payload: payload_skipped_warmUp_downsampled,
|
|
841
842
|
sampleRate: fMLS,
|
|
842
|
-
numPeriods:
|
|
843
|
-
(this.numMLSPerCapture - this.num_mls_to_skip) /
|
|
844
|
-
(2 * this._calibrateSoundBurstDownsample),
|
|
843
|
+
numPeriods: (this.numMLSPerCapture - this.num_mls_to_skip) / factor,
|
|
845
844
|
downsample: this._calibrateSoundBurstDownsample,
|
|
846
845
|
})
|
|
847
846
|
.then(async res => {
|
|
@@ -854,9 +853,7 @@ class Combination extends AudioCalibrator {
|
|
|
854
853
|
.getImpulseResponse({
|
|
855
854
|
mls,
|
|
856
855
|
sampleRate: fMLS,
|
|
857
|
-
numPeriods:
|
|
858
|
-
(this.numMLSPerCapture - this.num_mls_to_skip) /
|
|
859
|
-
(2 * this._calibrateSoundBurstDownsample),
|
|
856
|
+
numPeriods: (this.numMLSPerCapture - this.num_mls_to_skip) / factor,
|
|
860
857
|
sig: payload_skipped_warmUp_downsampled,
|
|
861
858
|
fs2: this.fs2,
|
|
862
859
|
L_new_n: this.L_new_n,
|