gpt4 book ai didi

javascript - 如何在 react-wavesurfer 中获取当前播放时间?

转载 作者:行者123 更新时间:2023-11-30 21:09:00 27 4
gpt4 key购买 nike

我需要获取音频的当前播放时间。我一直在使用 react-wavesurfer播放音频的包,我可以看到 wavesurfer.js有一种获取当前播放时间的方法,但我似乎无法弄清楚如何用 React 来做到这一点。

最佳答案

他们的 DOCS 中似乎有 onPosChange 事件

Is basically called on audioprocess and seek events and consolidates the received time formats into the same type of argument object as the onAudioprocess callback (time in seconds, not as a relative value):

{   wavesurfer: wavesurferInstance,   originalArgs:
[playBackPositionInSecs]
}

它似乎与“无 react ”audioprocess 相同event :

关于javascript - 如何在 react-wavesurfer 中获取当前播放时间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46320902/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com