Using Wavesurfer as a front end UI only, no audio source. Looking for advice on coding this feature. #3571
-
Hello, I would like to use WaveSurfer as a front end player UI (because it's an amazing UI) but I'm not using the audio part, and will not be using audio sources (no blank / empty wav blobs, or audio sources etc) as a workaround. I want WaveSurfer to play, and timer/bar to move (aka I instantiate WS, tell it duration, and it will play visually, but create no sound). I may need to use durations ranging from 1 minute to 24 hours or more and have hundreds of WaveSurfer instances in an app or across multiple screens. If there's no way to handle this use case, I would love to build one. Perhaps as a WaveSurferOptions?
Any advice on where to start, or gotchas to work on this to do a pull request? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 6 replies
-
Hey @KaleSurfer, thank you for the generous donation! ❤️ Wavesurfer already supports a slient mode (since 7.7.0). You can just skip the Alternatively, you can do it with wavesurfer.load('', peaks, duration) Let me know if this works for your use case, happy to adjust the API. Cheers! |
Beta Was this translation helpful? Give feedback.
-
Thank you for the response, I'll try this out asap. Update: |
Beta Was this translation helpful? Give feedback.
-
For that to work you might need to add |
Beta Was this translation helpful? Give feedback.
-
Thanks, I tried backend Webaudio using the load() method you mentioned above with '' url param, and it played, and fired 'seeking', but only after the 1st click or 2nd click did it visually change. Modifying load to an empty waveform (still using backend webaudio) required no extra click. Not sure why it's doing that, but perhaps a bug? Very close to the behavior I was looking for. |
Beta Was this translation helpful? Give feedback.
-
True, there's a bug with seeking with the I can reproduce it here: https://wavesurfer.xyz/examples/?28c9974160c53983e6d6d5286e0f0558 I'll file a bug report. Edit: |
Beta Was this translation helpful? Give feedback.
-
I'd like to do this with the multitrack plugin, but it's not working. I know it's not supported, but since this is just the discussion section, I wanted to get any feedback. When I call multitrack 'addTrack' with the options for a silent file (backend = 'WebAudio', peaks provided, duration provided) it does not work. From my debugging, it seems that multitrack will calculate duration based on the audio (or lack thereof) provided instead of using the options provided. This works fine using wavesurfer.js standalone, but the duration is ignored using multitrack. Any ideas on how to workaround this? |
Beta Was this translation helpful? Give feedback.
Hey @KaleSurfer, thank you for the generous donation! ❤️
Wavesurfer already supports a slient mode (since 7.7.0). You can just skip the
url
and only provide peaks and duration, and it will render a waveform.See https://wavesurfer.xyz/examples/?28c9974160c53983e6d6d5286e0f0558
Alternatively, you can do it with
load
like this:Let me know if this works for your use case, happy to adjust the API.
Cheers!