-
Hi, I have a personal project that I'm hoping would help my band members practice better. I just recently upgraded to wavesurfer v7, and fully converted to Media Element backend and it's fantastic. It uses so much less memory andprovides a bunch of wonderful featuers like session metadata which I absolutely love. However, when I try to play ~8 audio tracks at the same time, it overloads the CPU then induces significant latency between tracks. It becomes more apparent on lower-spec hardware like a 5-year-old iPads, etc. It works flawlessly on my gaming PC, where I do most of my development and testing. I think it's the sheer computing power required to decode that many audio blobs at the same time, which is the inevitable trade-off with the pre-decoding method. (I did not have sync-related issues with pre-decoded audio buffer) I tried to manually syncrhonize the tracks as per katspaugh's comment but in my project, it actually did me more harm than good. I know this is not a wavesurfer question nor wavesurfer issue. I am just hoping for some insight from people with more experience than mine (which is zero).... Thanks in advance to anyone who might come acrcorss this post and decide to spend time to type something for me. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Thank you so much for validating the move to MediaElement! The playback sync issues might be also related to the partial loading of audio files which is the default mode in most browsers. It fetches a small portion as it plays. There’s no way to force a preload but you could set it to auto (see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/preload). To pass the attribute, you’d have to init a media element yourself like in this example: https://wavesurfer.xyz/examples/?video.js |
Beta Was this translation helpful? Give feedback.
Thank you so much for validating the move to MediaElement!
The playback sync issues might be also related to the partial loading of audio files which is the default mode in most browsers. It fetches a small portion as it plays. There’s no way to force a preload but you could set it to auto (see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/preload).
To pass the attribute, you’d have to init a media element yourself like in this example: https://wavesurfer.xyz/examples/?video.js