xNul / drop

A LÖVE visualizer and music player
MIT License
20 stars 2 forks source link

Audio playback repeated skipping on some audio formats and systems #43

Closed xNul closed 3 years ago

xNul commented 3 years ago

The skipping happens periodically, causes skipping of anywhere from milliseconds of audio to multiple seconds. The varying nature of the bug suggests a mechanic that can be variable is at fault such as the buffering of the queueable audio sources. I suspect Drop isn't buffering the audio properly.

xNul commented 3 years ago

It turns out there are two problems that combine to create this bug. The first is Drop is not pre-buffering to fully scale with the bitrate of the audio it is processing. The second is, after running out of buffered audio, the queueable audio source pauses. It should play immediately after refilling the queue. Not accounting for this edge case caused the queueable audio source to pause for an extended period of time and the visualizer to decode audio in the meantime, not playing the audio, and resulting in the skip of multiple seconds of audio until the queueable audio source was eventually set to play once again, by an unrelated function call.

xNul commented 3 years ago

I'll have to merge this into the custom-visualizations branch eventually. Hopefully this bug is fixed for good. It was impactful enough to bring me back from a 3 year hiatus.