@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/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 { peak, rms } = event.data;
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 < peak.length; ch++) {
2121
- smoothed[ch] = Math.max(peak[ch], ((_a = smoothed[ch]) != null ? _a : 0) * PEAK_DECAY);
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(rms[ch]));
2124
+ rmsValues.push(gainToNormalized(data[workletChannels + ch]));
2124
2125
  }
2125
2126
  setLevels(peakValues);
2126
2127
  setRmsLevels(rmsValues);