BGM Lag/Delay Fix

I'm here just to request this in the next updates.

I would like you to consider adding this on your "to do" list. 🙂

Description of the Feature:
The title kinda says everything. I think most people here already experienced the BGM delay when starting the game, changing maps in-game, starting a battle, etc, either in play test or finished game.

Code for Implementation:
Maybe, making the BGM loads in the "loading screen" instead of after the map was loaded. BTW, this doesn't happen with .wav files when loading the map BGS.

Why is this feature good?
This feature is great because of the following:
  • Who wants the BGM to delay when changing the maps?

Possible issues with this feature?
Issues that might arise from this feature:
  • Maybe longer "load screens"?
I would love this in MV! I personally have been having lots of issues with this bug, especially with MP3 files downloaded from YouTube and changed into OGG to use in MV. Please fix this glitch please!
@DewottKid Illegal rips often have additional problems. I don't think you can expect Degica to sort those out for you.
@Kes I have this problem too. And I use only legal BGMs from the RTP, oficial packs, or that I composed myself.

Using illegal rips is not cool, but the problem is not there, it's somewhere in the loading files functions.
@CleanWater I wasn't intending to imply that this was a problem only with illegal rips, because it's not. What I was picking up on was the remark that DewottKid made that their problem was 'especially with' rips. That's what I was referring to when I said about 'additional' problems, and those additional ones can't be sorted out by Degica.
@CleanWater I wasn't intending to imply that this was a problem only with illegal rips, because it's not. What I was picking up on was the remark that DewottKid made that their problem was 'especially with' rips. That's what I was referring to when I said about 'additional' problems, and those additional ones can't be sorted out by Degica.
Ah ok, my bad then.

BTW, do we have any response from Degica regarding this matter? Will they take a look at this for next updates?
Its as fixed as they can make it due to how Javascript works. There is an unofficial fix here, which is as good as it can get due to the language requiring all audio files be fully loaded before they will play: https://atelieririna.itch.io/anti-audio-delay
Its as fixed as they can make it due to how Javascript works. There is an unofficial fix here, which is as good as it can get due to the language requiring all audio files be fully loaded before they will play: https://atelieririna.itch.io/anti-audio-delay
For what I can see on the plugin description, this works with events only, right? It only preloads audio that is about to play in events for cutscenes or those which change the music in the middle of the map, but does not fix the problem with the audio delay set on the Map Properties, or those audio files set on the system tab in the Database (such as Battle BGM, Airship BGM, Title BGM...).

The thing here, is to find a solution for everything related with the audio delay, and not only inside a game, but in the engine itself, since RPG Maker MV still delays the audio when you are using the Sound Test window. It seems to be something more complex that only using plugins to fix that, something that seems related to the program, too.
@Oscar92player : It's due to how Javascript loads files. The only true fix would be to change the language, which is not going to happen with MV as it would break every single person's project.
@Oscar92player : It's due to how Javascript loads files. The only true fix would be to change the language, which is not going to happen with MV as it would break every single person's project.
If that's the case, I wish the next RPG Maker comes with another language, one less buggy than JavaScript, but not too limited like Ruby 😅
Doubt it will matter. The 'issue' is the BGM *must* be fully loaded before it can start playing it. I'm not aware of ANY major language that doesn't do that at the moment. So the delay is due to the time it takes to load the file and get it ready for use internally, and that is often worse on .mp3/.mp4 due to the different encodings and such used on them.

The best solution is to use shorter files. I've never had an audio delay at all that was noticeable since version 1.1 of MV.

Also, side note: This issue is in many games, not just RPGMaker games. I was playing an old 90's game and it had a small audio delay too. There really is no solution for how to handle the computer needs to wait until the file is loaded and ready to play, unless you want to freeze the entire game while it loads the file.
Doubt it will matter. The 'issue' is the BGM *must* be fully loaded before it can start playing it. I'm not aware of ANY major language that doesn't do that at the moment. So the delay is due to the time it takes to load the file and get it ready for use internally, and that is often worse on .mp3/.mp4 due to the different encodings and such used on them.

The best solution is to use shorter files. I've never had an audio delay at all that was noticeable since version 1.1 of MV.

Also, side note: This issue is in many games, not just RPGMaker games. I was playing an old 90's game and it had a small audio delay too. There really is no solution for how to handle the computer needs to wait until the file is loaded and ready to play, unless you want to freeze the entire game while it loads the file.
I've played a bunch of games in my live, some of them from older consoles or PCs, and modern ones, and maybe it is not the first time I see the audio delay issue, but it is not pretty common, neither on older games nor modern ones. Never had that kind of bug on older RPG Makers or games made with them, by the way. There must be specific circumstances for a game to have this kind of issues, like a bad optimization for a platform (like some of the actual games for PC), or bad programming (I think everyone knows about Sonic The Hedgehog '06). Other thing that can cause this issue, and it is reasonable one, is because the game is being emulated, since you are not running it on the original hardware.

I don't know if there are games made with JavaScript outside RPG Maker MV, but if they are there, the developers probably have a way to surpass this kind of bug, that's for sure. No one wants a game that breaks the environment of maps and cutscenes with that annoying audio delay.
Most do it by adding delays themselves. You can do it too on the map transfer via eventing. Or you can fake a loading screen there by eventing. Take your pick.

Still I've hit no audio delays and almost no one reports it anymore so odds are its something mv can't fix. Maybe pixi on your computer is slow to load? Mv uses pixi for many things too.
Most do it by adding delays themselves. You can do it too on the map transfer via eventing. Or you can fake a loading screen there by eventing. Take your pick.

Still I've hit no audio delays and almost no one reports it anymore so odds are its something mv can't fix. Maybe pixi on your computer is slow to load? Mv uses pixi for many things too.
Well, in theory, PIXI works almost fine now that I've downgraded my PC to the original W8.1 OS, unlike W10 that gave me too much problems. The audio delay persists in a vanilla project, with no plugins at all. But with preloading plugins and some other configurations, there are no audio delays on my project, at least on my computer, but I'm afraid I don't know how effective would be on others.
Considering neither I or a dev team member could replicate the delay on your project before you added the preloader, hard to say. Still, the best fix is to use small audio files.

On a side note (for anyone else reading this thread): Check your speakers. I get an audio delay when I'm on headphones but not when I'm using my speakers. So something in how the CPU has to reprocess it for my headphones causes a short 2 second delay on my computer. Might be hardware based, might be driver based, might just be my headphones being weird and not turning on right away when a sound file is sent to them via the HTML5 based format MV uses.
This audio delay is really annoying. It happens to me since I have the rpg maker mv. I really think a solution would be if they worked the loading screen to preload the audio. There is always a way to improve. To fix this I use the chaucer plugin, SceneStabilizer, and it loads all things on the map before the map starts. This increases the loading time, but eliminates the delay of the audios. But anyway, it's a plugin, and I believe this should be implemented as standard on mv.
Personally I will recommended https://forums.rpgmakerweb.com/inde...mprove-rpg-maker-mv-audio-performance.110063/ to be part of MV Core.
Not only it solve the problem with delay, it also solve the problem for the need to prepare 2 audio formats in MV Project, ogg and m4a.

This one is the original author of AudioStreaming.js
https://forum.tkool.jp/index.php?threads/音声を高速に読み込むプラグイン.3095/
@RyanBram : Unless that plug-in also handles the fact that mobile OS need a different format than PC, that will not fix it for everyone. But it might work for those who don't care about making the game for mobile.
@bgillisp It handled it because it has built in Vorbis engine from stb_vorbis.c converted to asm.js using emscripten.

You may want to visit to original Tkool forum using Google Translate. This plugin has many positive feedback (seeing that the forum is not as busy as this one). The author is one of the Mod there and actively response to any bug report.

Original thread: https://forums.rpgmakerweb.com/threads/bgm-lag-delay-fix.101232/