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 277 forks source link

Multi-track support? #432

Open JackMF opened 2 years ago

JackMF commented 2 years ago

I would like to draw waveforms of multiple wave forms - much like the view and control that you would see in a DAW. Can peak.js support such a feature? I understand there is "multichannel" support but I am not sure if this would cover this use-case

chrisn commented 2 years ago

The multi-channel support is for channels within a single audio file (e.g., left and right stereo channels), not really for separate audio tracks. How are you loading the multiple waveforms - do you have multiple AudioBuffers, for example? It may be possible to use multiple Peaks instances to implement multiple waveform views. Each Peaks instance would have its own AudioBuffer, and each instance would use the same single common external Player object, which would coordinate playback and seeking, etc. Just an idea, I haven't tried it so I don't know how well it would work.

JackMF commented 2 years ago

Hello @chrisn - many thanks for your reply.

Yes I have multiple AudioBuffers which I turn into audio source nodes and playback simultaneously.

Each Peaks instance would have its own AudioBuffer, and each instance would use the same single common external Player object, which would coordinate playback and seeking, etc. Just an idea, I haven't tried it so I don't know how well it would work.

I wll try this and report back. Thank you for suggesting an approach!

nuboa commented 2 years ago

Hi @JackMF, i need multi-track support too for my project. Did it work? Any update on this?

cubancodepath commented 5 months ago

Hello @chrisn - many thanks for your reply.

Yes I have multiple AudioBuffers which I turn into audio source nodes and playback simultaneously.

Each Peaks instance would have its own AudioBuffer, and each instance would use the same single common external Player object, which would coordinate playback and seeking, etc. Just an idea, I haven't tried it so I don't know how well it would work.

I wll try this and report back. Thank you for suggesting an approach!

Hi man, Did it work for you? If not could you please share which approach did you take?

jawwad-dev commented 1 week ago

Hey Guys! Have you implemented the multi-track? I need to implement it in my project as well. If so, can you please share your approach?