question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can the generated waveform be saved ?

See original GitHub issue

Hello, I didn’t find a consitant documentation for saving the generated waveform data. I’ve tried wavesurfer.on('ready', function () { // the width of the waveform in double pixels var width = wavesurfer.getDuration() * wavesurfer.params.minPxPerSec * wavesurfer.params.pixelRatio; var dataJSON = wavesurfer.backend.getPeaks(width); console.log (dataJSON); });

But its empty… What is the best method to do this exportPCM ? backend.getpeaks() ?

Best P.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
X-Raymcommented, Dec 21, 2017

@the1the you can use var peaks = object.backend.getPeaks(960); … where object is your wavesurfer object. 960 means 1920 long array so it is enoufg from small to widescreen if the waveform is meant to not be zoomed.

Then, just wrap this in a AJAX request to generate your json file. You can add extra infos in it (I personally add audio length and audio URL).

0reactions
the1thecommented, Jan 23, 2018

` wavesurfer.on(‘ready’, function () { // the width of the waveform in double pixels //var width = wavesurfer.getDuration() * wavesurfer.params.minPxPerSec * wavesurfer.params.pixelRatio; var dataJSON = wavesurfer.backend.getPeaks(960); console.log (dataJSON);

        });

Returns array[0]

so what I’m I doing wrong? Any help very appriciated.`

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I save a waveform I've created and ... - MathWorks
How can I save a waveform I've created and stored in a variable into a raw audio file .Can an example be given...
Read more >
Saving waveform in vivado - Xilinx Support
1) open the project and run simulation · 2) Add desired signals to waveform. · 3)log_wave -r * · 4) restart ; run...
Read more >
Save Waveform File - NI - National Instruments
Select the Save Waveform File menu and select Current Settings option to display the Save Waveform File dialog box as shown in the...
Read more >
How do I save a waveform from ModelSim for later opening ...
You need to save the waveform/dataset as a .wlf file. To tell Modelsim to capture all signal values in the design you can...
Read more >
How to Save your Waveform Setup in PSIM - YouTube
In this short tutorial video, we show how you can save your waveform setup in SimView. By saving a setup file, you can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found