NUKnightLab/soundcite

Smoother loops

Opened this issue · 3 comments

Via @ThomasHelzle on #39

Not sure if that can be solved by soundcite: I get clicks and a short interruption on each loop. The same soundfile loops smoothly for instance with http://mediaelementjs.com/

This could probably be fixed by, instead of using pause/play (soundcloud popcorn) we could seek the clip to the start time.

Should definitely wait until after #48.

I'm not getting any clicks in my tests, but there is a gap. I can't find any way to prevent it.

I looked into how a few other js libraries handle looping, and they all do a variation of what we're doing. None of them are perfectly gap-less, but some come closer. Example: http://www.schillmania.com/projects/soundmanager2/demo/api/#looping

MediaElementsJS doesn't have a working demo of their looping function, so I haven't been able to verify it's gap-less. If @ThomasHelzle has an example, I'd love to see it.

Are we hosting the popcorn library now? Could the gap be coming from the milliseconds it takes to reach an external library?

Another solution could be to have a short fade-in/fade-out when looping, so the gap is less abrupt.

Sorry for the late reply.
I just tested it again and you are right, although I would have sworn I had gap-less and click-less audio loops in mediaelements when I first implemented it for my website, otherwise I would have used longer loops in some cases. Maybe it was only with the Flash fallback or something? Or it depends on the sounddevice used?
If it can't be helped it can't be helped - weird that something so basic isn't covered by all those medialibraries and audio implementations...

Thanks for trying !!!

Cheers,

Tom

Can anyone comment as to whether this is still an issue? The player does, in fact, use a seek to beginning rather than pause/play (see here and here. I would expect to hear differences depending on whether end end-time is defined before the sound actually ends. Also whether there are gaps at the beginning. Please let me know if this is still an issue or if I can close this.