@wq-hook/volcano-react 1.0.4 → 1.0.5
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/index.js +3 -2
- package/dist/index.mjs +3 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1889,9 +1889,10 @@ var AudioWaveVisualizer = ({
|
|
|
1889
1889
|
ctx.strokeStyle = fillStyle;
|
|
1890
1890
|
if (style === "bar" && frequencyData) {
|
|
1891
1891
|
const barWidth = w / bars;
|
|
1892
|
-
const step = Math.floor(frequencyData.length / bars);
|
|
1893
1892
|
for (let i = 0; i < bars; i++) {
|
|
1894
|
-
const
|
|
1893
|
+
const halfLength = frequencyData.length / 2;
|
|
1894
|
+
const index = Math.floor(i / bars * halfLength);
|
|
1895
|
+
const value = frequencyData[index] || 0;
|
|
1895
1896
|
const percent = value / 255;
|
|
1896
1897
|
const barHeight = h * percent;
|
|
1897
1898
|
ctx.fillRect(i * barWidth, h - barHeight, barWidth - 2, barHeight);
|
package/dist/index.mjs
CHANGED
|
@@ -1845,9 +1845,10 @@ var AudioWaveVisualizer = ({
|
|
|
1845
1845
|
ctx.strokeStyle = fillStyle;
|
|
1846
1846
|
if (style === "bar" && frequencyData) {
|
|
1847
1847
|
const barWidth = w / bars;
|
|
1848
|
-
const step = Math.floor(frequencyData.length / bars);
|
|
1849
1848
|
for (let i = 0; i < bars; i++) {
|
|
1850
|
-
const
|
|
1849
|
+
const halfLength = frequencyData.length / 2;
|
|
1850
|
+
const index = Math.floor(i / bars * halfLength);
|
|
1851
|
+
const value = frequencyData[index] || 0;
|
|
1851
1852
|
const percent = value / 255;
|
|
1852
1853
|
const barHeight = h * percent;
|
|
1853
1854
|
ctx.fillRect(i * barWidth, h - barHeight, barWidth - 2, barHeight);
|