@waveform-playlist/browser 15.2.0 → 15.3.0
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/README.md +104 -0
- package/dist/index.d.mts +25 -3
- package/dist/index.d.ts +25 -3
- package/dist/index.js +47 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +63 -21
- package/dist/index.mjs.map +1 -1
- package/dist/tone.js +5 -4
- package/dist/tone.js.map +1 -1
- package/dist/tone.mjs +5 -4
- package/dist/tone.mjs.map +1 -1
- package/package.json +8 -9
package/dist/tone.mjs
CHANGED
|
@@ -2113,14 +2113,15 @@ function useOutputMeter(options = {}) {
|
|
|
2113
2113
|
workletNode.port.onmessage = (event) => {
|
|
2114
2114
|
var _a;
|
|
2115
2115
|
if (!isMounted) return;
|
|
2116
|
-
const
|
|
2116
|
+
const data = event.data;
|
|
2117
|
+
const workletChannels = data.length / 2;
|
|
2117
2118
|
const smoothed = smoothedPeakRef.current;
|
|
2118
2119
|
const peakValues = [];
|
|
2119
2120
|
const rmsValues = [];
|
|
2120
|
-
for (let ch = 0; ch <
|
|
2121
|
-
smoothed[ch] = Math.max(
|
|
2121
|
+
for (let ch = 0; ch < workletChannels; ch++) {
|
|
2122
|
+
smoothed[ch] = Math.max(data[ch], ((_a = smoothed[ch]) != null ? _a : 0) * PEAK_DECAY);
|
|
2122
2123
|
peakValues.push(gainToNormalized(smoothed[ch]));
|
|
2123
|
-
rmsValues.push(gainToNormalized(
|
|
2124
|
+
rmsValues.push(gainToNormalized(data[workletChannels + ch]));
|
|
2124
2125
|
}
|
|
2125
2126
|
setLevels(peakValues);
|
|
2126
2127
|
setRmsLevels(rmsValues);
|