向波形添加注释

Adding comments to waveform

谁能告诉我如何使用 wavesurfer.js 在波形中创建注释?就像 SoundCloud 一样。 非常感谢!

要获得与 00:00 相同的时间,您可以执行以下操作,例如:

function timeformat(timeget) {
    if (!timeget) {return "00:00";}

    var min = Math.floor(timeget / 60);
    var sec = Math.ceil(timeget) % 60;

    return (min < 10 ? '0' : '') + min + ":" + (sec < 10 ? '0' : '') + sec;
};
timeformat(wavesurfer.getCurrentTime());