Skip to content

Commit

Permalink
fix: audio peaks calc depends on normalize prop
Browse files Browse the repository at this point in the history
  • Loading branch information
eins78 committed Jul 16, 2021
1 parent 148ed14 commit f7c19ad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/AudioAnalyzer.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export function AudioPeaks({ buffer, bands = 100, trimPoints = [0, 0], normalize
if (!(audioContext && bufferLength > 0)) {
return setPeaks(null)
}

// NOTE: no `await`, Safari only supports the callback style
audioContext.decodeAudioData(
buffer.slice(),
Expand All @@ -89,7 +90,7 @@ export function AudioPeaks({ buffer, bands = 100, trimPoints = [0, 0], normalize
}
)
},
[buffer, bands, trimPoints, audioContext]
[buffer, bands, trimPoints, normalize, audioContext]
)

const data = { peaks, decodeError }
Expand Down

0 comments on commit f7c19ad

Please sign in to comment.