Replies: 1 comment 1 reply
-
Hey, good catch! Dividing by |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
Love the libary by the way. I'm using
height: 'auto'
so the waveform fills its parent container (height: 250px). This work fantastically until I want to toggle split channel. Both canvases haveheight : auto
and it caluculates height the same way. Where in theory it should dothis.parent.clientHeight / 2
so it still fits nicely in the parent container.What its doing when height is set to auto:
Screen.Recording.2024-05-08.at.11.46.08.mov
What I want it to do: ( i acheived this by hard coding the heights and divide by 2 if its dual channel)
Screen.Recording.2024-05-08.at.11.50.30.mov
Do you have any suggestions for what i could do? Obvs i could hard code the height instead of using auto. But I'd really rather define the height in a parent component so I don't have to go into wavesurfer config object to adjust it.
I've isolated it down to the getHeight() function
Would it be feasable to also take in audioData.numberOfChannels into the calculation. I was thinking a bit of logic:
Let me know your thoughts
Beta Was this translation helpful? Give feedback.
All reactions