Open featurecat opened 1 year ago
Just started using the plug-in and also noticed this.
This seems to occur when an overridden track restarts, and the track is in mp3 format. Wav files do not seem to have this issue.
Thanks fuzxi. I'll try it out. I came up with this command to convert all tracks in the folder to wav using ffmpeg
(Windows cmd):
for /r %i in (*) do ffmpeg -i "%i" -vn -acodec pcm_s16le -ar 44100 -ac 2 "%~ni.wav"
(https://ffmpeg.org/download.html,
https://superuser.com/questions/609740/extracting-wav-from-mp4-while-preserving-the-highest-possible-quality)
Unfortunately, now music-replacer runs out of memory when trying to load large tracks.
Amascut's Promise was the longest track, and that was causing an out of memory issue. I fixed it by just allocating more memory to RuneLite. You can do this at your own risk by:
%APPDATA%\..\Local\RuneLite
(has a lot of DLLs)config.json
"-Xmx512M"
with "-Xmx1g"
or your preferred memory usage. I also set "-Xms512m"
but I'm not sure if it's useful.config.json
, select Properties
, and enable Read-only
.TLDR: using wav files instead of mp3s fixes the issue, but for long tracks you'll need to allocate more memory to RuneLite.
Actually: Using wav actually seems to be laggier during the actual track so mp3 just ends up being better. The RuneLite memory trick is interesting though.
The plugin is currently copying the track it's going to play on the client thread which isn't a very smart move. I'm pretty sure it'll happen for both wav and mp3 and since wav tends to be bigger the move will take longer. The reason it's semi needed is because otherwise you get problems removing/overriding a playing track because the file is still in use. Ideally either the move wouldn't be done at all, or done on a separate thread. I'm not sure when I'll have(/make) time for it to fix it though.
To reproduce, override any track with a short 2-second-long track. Enable looping, the game will have frequent FPS drops.