调整音频可视化参数

pull/930/merge
lyswhut 2022-01-05 15:49:40 +08:00
parent fce8719432
commit c7f0fcbe9f
1 changed files with 2 additions and 2 deletions

View File

@ -70,7 +70,7 @@ export default {
for (let i = 0; i < bufferLength; i++) {
mult = Math.floor(i / maxNum)
num = mult % 2 === 0 ? (i - maxNum * mult) : (maxNum - (i - maxNum * mult))
let spectrum = num > 80 ? 0 : dataArray[num + 20]
let spectrum = num > 90 ? 0 : dataArray[num + 20]
frequencyAvg += spectrum * 1.2
}
frequencyAvg /= bufferLength
@ -89,7 +89,7 @@ export default {
// let b = 50
// ctx.fillStyle = 'rgb(' + r + ',' + g + ',' + b + ')'
barHeight = barHeight * frequencyAvg + barHeight * 0.4
barHeight = barHeight * frequencyAvg + barHeight * 0.42
ctx.fillRect(x, HEIGHT - barHeight, barWidth, barHeight)
x += barWidth