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.21k stars 279 forks source link

Simple music player - possible to remove advanced features - zooming and segmenting? #193

Open jurgenwerk opened 7 years ago

jurgenwerk commented 7 years ago

I'm building a simple web music player app and since I'm generating waveform data using audio_waveform-ruby I thought about using peaks.js to display the waveform along with a simple play/pause interface and track progress indicator.

Basically, I'd like to replicate SoundCloud's player:

image

Is it possible to use a stripped-down version of peaks.js to implement a simple music player like this? How would you go about it?

And thanks for making peaks.js 🙏 .

chrisn commented 7 years ago

Thanks for the kind feedback!

Peaks.js is currently designed to have the two waveform views you see in this screenshot image. There are other projects out there that are closer to what you want, are there particular reasons you prefer Peaks.js?

That said, there is work underway to restructure the code to support a single view, but it's slow progress due to the time I have available.

If you want to do it yourself, you could always take the Peaks.js code and strip out all the functionality you don't need. There's code in this pull request to implement the highlight (orange) region.

chrisn commented 5 years ago

Release 0.10.0 allows you to create a single waveform view. Please see https://github.com/bbc/peaks.js/blob/master/demo/overview-waveform.html for an example.