Skip to content
Discussion options

You must be logged in to vote

Appreciate the feedback!

1. Load, URL and peaks

Regarding the url and peaks properties, both can be passed as either a create option or as arguments to load.

As create options:

const wavesurfer = WaveSurfer.create({
  container: '#container',
  url: 'https://...',
  peaks: [[...], [...]]
})

As load arguments:

const wavesurfer = WaveSurfer.create({
  container: '#container',
})

wavesurfer.load('https://...', [[...], [...]])

2. Exporting peaks

Yes, correct, you can pass channelData arrays directly as peaks, one array per channel.

E.g.

const exportPeaks = (): Array<Float32Array> => {
  const buffer = wavesurfer.getDecodedData()
  const peaks = []
  for (let i = 0; i < buffer.numberOfChannels; 

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
1 reply
@doctor30309
Comment options

Comment options

You must be logged in to vote
8 replies
@doctor30309
Comment options

@katspaugh
Comment options

@robots4life
Comment options

@katspaugh
Comment options

Answer selected by doctor30309
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
3 participants
Converted from issue

This discussion was converted from issue #2931 on June 23, 2023 19:42.