bbc / peaks.js

JavaScript UI component for interacting with audio waveforms
https://waveform.prototyping.bbc.co.uk
GNU Lesser General Public License v3.0
3.16k stars 275 forks source link

"This waveform data version not supported" #510

Closed WilliamHayward108 closed 7 months ago

WilliamHayward108 commented 7 months ago

I'm current hitting this error in the Waveformdata.create function. I am passing a datauri as my waveform source, the .json that is being passed is

{"version":2,"channels":1,"sample_rate":44100,"samples_per_pixel":256,"bits":8,"length":2611,"data":[0,0,0,0,0]}

I've shortened the data array for the purposes of making this issue, the version is '2' which from what I can see is supported by peaks so I'm not too sure what the issue is

chrisn commented 7 months ago

Your example file looks OK. Are you using the json option when you can Peaks.init() ? You'll get this error if you use arraybuffer.

dataUri: {
  json: '/v2.json'
},
WilliamHayward108 commented 7 months ago

That was it, a silly oversight on my part. Thanks!