简体   繁体   中英

Is there a way to seek music with Web Audio API without buffering

I'm trying to make a music player for my dj mixes(Most over an hour long), whilst also taking advantage of Web Audio Contexts analyzer node to have some audio reactive elements on my website on playback. When looking into it, I found that to do music seeking with audio context I need to buffer it .

Buffering an hour long mix takes up a lot of ram and internet bandwidth before it even starts playing, so that's not something I can do on a website. But also listening to mixes with many songs without the ability to skip around is annoying as well.

How do big websites like mixcloud or soundcloud do it?

Is there an alternative way to get both AnalyserNodes functionality and music seeking for long audio content?

I also looked into howler.js hoping it would solve something, but I can't get it to do what I need without buffering either, since its built on top of the same API.

Learned from this open source project:

media = document.querySelector('audio');
media.currentTime = 3600; // set playhead 1 hour in
media.play();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM