@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.js CHANGED
@@ -2129,14 +2129,15 @@ function useOutputMeter(options = {}) {
2129
2129
  workletNode.port.onmessage = (event) => {
2130
2130
  var _a;
2131
2131
  if (!isMounted) return;
2132
- const { peak, rms } = event.data;
2132
+ const data = event.data;
2133
+ const workletChannels = data.length / 2;
2133
2134
  const smoothed = smoothedPeakRef.current;
2134
2135
  const peakValues = [];
2135
2136
  const rmsValues = [];
2136
- for (let ch = 0; ch < peak.length; ch++) {
2137
- smoothed[ch] = Math.max(peak[ch], ((_a = smoothed[ch]) != null ? _a : 0) * PEAK_DECAY);
2137
+ for (let ch = 0; ch < workletChannels; ch++) {
2138
+ smoothed[ch] = Math.max(data[ch], ((_a = smoothed[ch]) != null ? _a : 0) * PEAK_DECAY);
2138
2139
  peakValues.push((0, import_core4.gainToNormalized)(smoothed[ch]));
2139
- rmsValues.push((0, import_core4.gainToNormalized)(rms[ch]));
2140
+ rmsValues.push((0, import_core4.gainToNormalized)(data[workletChannels + ch]));
2140
2141
  }
2141
2142
  setLevels(peakValues);
2142
2143
  setRmsLevels(rmsValues);