Wavesurfer.js: Generated waveform with audiowaveform is half-complete

Created on 1 Aug 2017  Â·  13Comments  Â·  Source: katspaugh/wavesurfer.js

The command I use :
audiowaveform -i myfile.mp3 -b 16 -o myfile.json

What i get in my application :
capture2
(missing part in yellow, the blue peaks match the music perfectly )

Snippet of my json file :
{"sample_rate":44100,"samples_per_pixel":4410,"bits":16,"length":2318,"data":[-8,99,-2,91,7,167,-2512,2011,-2447,2009,-2475,1922,-2338,1626,-2356,1624,-2556,1697,-3050,1899,-3175,2268,-2978,2105,-2925,.....

What is the problem here ? Not enough peaks data are generated ?

Also i use :
normalize: true as wavesurfer param
And I filter the peaks data like that :
response.data.data.filter(function(value) { return value >= 0; })

bug

Most helpful comment

@GitHubRakeshSharma My bad, use this:

git clone [email protected]:katspaugh/wavesurfer.js.git && cd wavesurfer.js && npm i && npm run build && npm link && cd ../ && npm link wavesurfer.js

it …

  • clones wavesurfer.js into the directory wavesurfer.js
  • installs the dependencies in that project
  • builds it (the dist directory)
  • links it so wavesurfer is resolved to that copy

to update you just git pull inside the wavesurfer.js directory.

This is just a quick-fix until the next beta release comes out.

All 13 comments

this will be fixed with pr #1182

I had the same issue. I found that the drawLineToContext method uses the canvas size in px as top limit in the drawing loop. I just changed it to be the local length parameter which is half the length of the converted array of peaks (meaning the one where negative values have been added alternatingly).

Should be fixed now. Please check if it works for you now. @GitHubRakeshSharma @BriceN @X-Raym

To install a npm package directly from github, do:
npm install katspaugh/wavesurfer.js#master

I did import the new version from the masterbranch... BUT: now the dist folder is missing. Can you generate one or could you tell me how to efficiently genrate one myself?

@GitHubRakeshSharma My bad, use this:

git clone [email protected]:katspaugh/wavesurfer.js.git && cd wavesurfer.js && npm i && npm run build && npm link && cd ../ && npm link wavesurfer.js

it …

  • clones wavesurfer.js into the directory wavesurfer.js
  • installs the dependencies in that project
  • builds it (the dist directory)
  • links it so wavesurfer is resolved to that copy

to update you just git pull inside the wavesurfer.js directory.

This is just a quick-fix until the next beta release comes out.

I am sorry to say that now it throws this Error... seems like some policy issue:

Cloning into 'wavesurfer.js'...
Warning: Permanently added the RSA host key for IP address '192.30.253.113' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

@mspae

This is just a quick-fix until the next beta release comes out.

When can we expect the next beta ? :)
(I assume it will have others bug fixes and enhancement so maybe it worths waiting a bit more to have an official build rather than making a custom one ?)

@X-Raym see the discussion at #1092 – i think/hope soon.

@GitHubRakeshSharma I don't know how your github ssh is set up. you may need to adjust cloning command.

I fixed my SSH and did the above... now I receive the following (seems like LINT does this):

./src/render_source/wavesurfer.js/dist/wavesurfer.min.js
  Line 6:  'define' is not defined     no-undef
  Line 6:  'define' is not defined     no-undef
  Line 6:  Unexpected use of 'screen'  no-restricted-globals
  Line 6:  Unexpected use of 'screen'  no-restricted-globals

I cannot find any restrictions in the lint config... is this a known thing? Do I overlook the obvious?

@GitHubRakeshSharma When do you get this error? When you run npm run build?

@X-Raym @GitHubRakeshSharma Have you tried out the new beta 2 version?

@mspae Just tested: seems to be good for me! Both peak generation and peak display from it! Thx !

I'll close this. If anybody still experiences problems please comment and I'll reopen.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SGDAT picture SGDAT  Â·  3Comments

CramericaIndustries picture CramericaIndustries  Â·  4Comments

Mamadou99 picture Mamadou99  Â·  3Comments

Trojan0523 picture Trojan0523  Â·  3Comments

daslicht picture daslicht  Â·  3Comments