You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to load a modplug file that defines an infinite loop, e.g. by specifying a jump back to the start on the final row, as either a static Source or SoundData, love freezes up and proceeds to flood the RAM of the machine.
Here is an example project with a suitable file simple_test_with_loop.it: modplug_repro.zip
I recommend having a process kill ready.
I did some research and there seems to be some baggage attached to the general behaviour with some interesting discussion on the SDL_mixer repo here: libsdl-org/SDL_mixer#117
Of notable interest is the following comment:
BTW, using modplug's builtin looping of the whole track also avoids silence at the end of the track which can happen when using SDL_mixer's looping.
Which is an observation also true for love and for that reason also part of the repro example above. Using source:setLooping(true) for a modplug file that does not define an infinite loop results in an audible silence between loops.
However, when an infinitely looping file is loaded as a streamed source, it will play forever without a delay between loops, regardless of whether setLooping(true) has been called.
Overall these quirks means that modplug audio cannot be treated like other audio at all: Looping only works when specific conditions in the file are met and these conditions require very particular management if the use case requires the use of queueable Source where using a stream Source and calling it a day is no longer an option.
I realize the best option is to just not use modplug but unfortunately that is not an option for me.
The text was updated successfully, but these errors were encountered:
When trying to load a modplug file that defines an infinite loop, e.g. by specifying a jump back to the start on the final row, as either a static Source or SoundData, love freezes up and proceeds to flood the RAM of the machine.
Here is an example project with a suitable file
simple_test_with_loop.it
:modplug_repro.zip
I recommend having a process kill ready.
I did some research and there seems to be some baggage attached to the general behaviour with some interesting discussion on the SDL_mixer repo here: libsdl-org/SDL_mixer#117
Of notable interest is the following comment:
Which is an observation also true for love and for that reason also part of the repro example above. Using
source:setLooping(true)
for a modplug file that does not define an infinite loop results in an audible silence between loops.However, when an infinitely looping file is loaded as a streamed source, it will play forever without a delay between loops, regardless of whether
setLooping(true)
has been called.Overall these quirks means that modplug audio cannot be treated like other audio at all: Looping only works when specific conditions in the file are met and these conditions require very particular management if the use case requires the use of queueable Source where using a stream Source and calling it a day is no longer an option.
I realize the best option is to just not use modplug but unfortunately that is not an option for me.
The text was updated successfully, but these errors were encountered: