speaker-calibration 2.2.255 → 2.2.257
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 +14844 -15460
- package/dist/listener.js +1 -1
- package/dist/main.js +3 -3
- package/dist/phonePeer.js +1 -1
- package/package.json +1 -1
- package/src/peer-connection/speaker.js +8 -0
- package/src/tasks/combination/combination.js +294 -273
- package/src/utils.js +11 -1
package/src/utils.js
CHANGED
|
@@ -200,6 +200,16 @@ export function convertAsterisksToList(content) {
|
|
|
200
200
|
return result;
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
|
|
203
|
+
export const reorderMLS = (mlsSignal, preSec, sourceSamplingRate) => {
|
|
204
|
+
// Number of samples to move
|
|
205
|
+
const numSamplesToMove = Math.round(preSec * sourceSamplingRate);
|
|
206
|
+
if (numSamplesToMove <= 0 || numSamplesToMove >= mlsSignal.length) {
|
|
207
|
+
// Nothing to reorder, return original
|
|
208
|
+
return mlsSignal;
|
|
209
|
+
}
|
|
210
|
+
const lastPart = mlsSignal.slice(-numSamplesToMove);
|
|
211
|
+
const firstPart = mlsSignal.slice(0, mlsSignal.length - numSamplesToMove);
|
|
212
|
+
return lastPart.concat(firstPart);
|
|
213
|
+
}
|
|
204
214
|
|
|
205
215
|
export {sleep, saveToCSV, saveToJSON, csvToArray,findMinValue,findMaxValue, standardDeviation, interpolate};
|