zhw2590582 / WFPlayer

:ocean: WFPlayer.js is an audio waveform generator
https://wfplayer.js.org
MIT License
262 stars 32 forks source link

Need help with setting up the subtitles on the waveform #32

Closed vivekd95 closed 1 year ago

vivekd95 commented 1 year ago

So, I need to add some subtitles to my waveform shown as in the screenshot attached below. In the following screenshot, I am using wfplayer version 1.1.4. I recently updated the wfplayer version to 2.1.3. To calculate the subtitle position according to the grid, I was using two values: this.wf.drawer.gridGap and this.wf.options.pixelRatio. Can you please tell me where I can find these values? Have you changed the path to these values or removed them? If yes, then in wfplayer version 2.1.3, how do you calculate subtitle position?

wavefrom

zhw2590582 commented 1 year ago

In wfplayer@2.2.0 version, it can be found in wf.drawer.config In wfplayer@2.2.2 version, it can be found in wf.config

or

wf.on('update', (config) => {
    console.log(config)
});