Skip to content

Local Blob as a Placeholder + Redraw Wave after Loading #3975

Answered by katspaugh
ssoronid asked this question in Q&A
Discussion options

You must be logged in to vote

To get low-res peaks, you're already using the right method (exportPeaks), just pass { maxLength: 400, precision: 1000, channels: 1 } or similar to limit how many peaks it returns.

You can also use the useWavesurfer hook from wavesurfer-react for convenience. Just make sure to memoize all the props you pass to it to avoid re-renderings. In your current code, the metadata callback isn't memoized, for example.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ssoronid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants