wavesurfer.js icon indicating copy to clipboard operation
wavesurfer.js copied to clipboard

seek issue with peaks generated server side

Open lauradP opened this issue 5 years ago • 5 comments

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).

image

image

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

lauradP avatar Nov 12 '19 16:11 lauradP

How the peaks generate, can you tell me ? Thanks . 不知道怎么生成peaks 文件,求助,谢谢。

web-linda avatar Nov 20 '19 10:11 web-linda

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

lauradP avatar Nov 20 '19 11:11 lauradP

Thank you very much .

It is no other sets, it will be auto to centered. Not use seekAndCenter function , I think.

web-linda avatar Nov 21 '19 02:11 web-linda

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?

lauradP avatar Nov 21 '19 08:11 lauradP

Hi @lauradP did you find any solution for this?

bugcoder avatar Aug 16 '22 19:08 bugcoder