Replies: 3 comments 4 replies
-
This feels like a step backwards. |
Beta Was this translation helpful? Give feedback.
-
@katspaugh might make sense to do the multi canvas option if it exceeds let's say 20 minutes of audio automatically while anything less sticks to a single one. |
Beta Was this translation helpful? Give feedback.
-
It turns out multi-canvas is still relevant, because although the total size of the canvas can be millions of pixels, the width is capped at ~32k pixels. So I've implemented multi-canvas in the new wavesurfer version as well. It also comes with performance improvements, because the canvases are rendered each with a small delay. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The maximum canvas size in most browsers is huge
According to MDN, major browsers seem to have a huge headroom when it comes to the maximum canvas size.
Some napkin calculations
If we take the minimum of 268,435,456 pixels (Chrome and Safari) – 268 millions! – and assume the typical height of a waveform is 400 px (to be generous), this gives us ~671k pixels of width.
If we assume a zoom level of 100 px per second, this gives us approximately 2 hours of audio.
That should be more than enough for most waveforms, shouldn't it?
Opimizations for the single canvas
In my experiments, I found that it's not necessary to render the height in a double resolution for hi-res screens. Doubling the width alone already results in a sharp image.
If we keep the height at x1, it will double the available canvas real estate.
Beta Was this translation helpful? Give feedback.
All reactions