Replies: 1 comment
-
Is that ChatGPT? There’s no fillWave. There’s a |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
To make the lower mirrored part of the waveform half the height of the upper part in wavesurfer.js, you can modify the fillWave function in the wavesurfer.js library. This function is responsible for drawing the waveform.
Unfortunately, there is no built-in option or configuration in wavesurfer.js to adjust the height of the mirrored part of the waveform separately from the upper part. Therefore, you would need to modify the library's source code directly. Can someone implement this?
Here's an example of how you might modify the fillWave function:
javascript
fillWave: function (x, start, end, fn) {
var halfH = this.halfH;
var coef = this.attenuation;
var length = end - start + 1;
var peaks = this.peaks;
}
In this code, peaks[2 * i + 1] / absmax * halfH is the calculation for the height of the lower part of the waveform. By dividing this by 2, you can make the lower part half the height of the upper part.
Beta Was this translation helpful? Give feedback.
All reactions