wavesurfer.js
wavesurfer.js copied to clipboard
seek issue with peaks generated server side
Hi, I have a strange issue with wavesurfer (ver. 3.2.0). I play mp3 files (-ab 64k -ar 32k, generated with ffmpeg) and since I have to handle long audio files I generate peaks server side using audiowaveform command line tool (--pixels-per-second 25 -b 16).
The player loads fine, but the seek is not very accurate. In the screen below you can see what happens once I execute seekAndCenter(1).
My init options are:
var options = {
container: '#waveform',
height: waveHeight,
waveColor: waveColor,
progressColor: progressColor,
backend: 'MediaElement',
normalize: true,
dragSelection: false,
minPxPerSec: 25,
pixelRatio: 1,
scrollParent: true,
plugins: [
WaveSurfer.regions.create(),
WaveSurfer.minimap.create({
container: '#wave-minimap',
height: minimapHeight,
waveColor: minimapWaveColor,
progressColor: minimapProgressColor,
cursorColor: cursorColor
}),
WaveSurfer.timeline.create({
container: '#timeline',
formatTimeCallback: formatTimeCallback,
timeInterval: timeInterval,
primaryLabelInterval: primaryLabelInterval,
secondaryLabelInterval: secondaryLabelInterval
})
]
};
The issue was found on Google Chrome. It works on Firefox.
Is something wrong with my parameters? Can anyone help me?
Thanks, Laura
How the peaks generate, can you tell me ? Thanks . 不知道怎么生成peaks 文件,求助,谢谢。
Peaks are generated using bbc audiowaveform command line (direcly in JSON) using these parameters: --pixels-per-second 25 -b 16
Moreover I made some steps, setting forceDecode parameter to "true" the waveform is accurate and the seek is OK, but waveform load takes a long time (up to 25 seconds).
Laura
Thank you very much .
It is no other sets, it will be auto to centered. Not use seekAndCenter function , I think.
Hi, thanks for your answer but I have two more points:
- My issue concerned waveform accuracy, not centering
- How can seekAndCenter function slow down wavesurfer loading? Should I disable something?
Hi @lauradP did you find any solution for this?