The core engine starts playing an audio track once it is ready, i.e. the data is loaded and, if appropriate, decrypted. Some contexts can't play OGG natively, thus need to resort to the built-in software decoder, which decodes in chunks...but playtest (Chromium) ought to be totally OK with OGG, so that's a moot point. 😴
Slow loading might result in an SE being played late, like in your first case. It might be due to direct interference from external applications, or simply because the disk is busy with other stuff at the moment.
Turan's suggestion of merging the sequence into 1 file is good. In case you want to investigate the cause, you could try using one of the first 4 system SEs (Cursor, OK, Cancel, Buzzer) instead, using one of these lines in a Script move command:
SoundManager.playCursor();
SoundManager.playOk();
SoundManager.playCancel();
SoundManager.playBuzzer();
System SEs are defined on the left side of the System 1 tab in the database. The first 4 are preloaded when the game launches, so they should have no load delay. These are uniquely buffered, though, so e.g. Cursor cannot overlap with Cursor.
The core Play SE command redirects to AudioManager.playSe(obj) regardless of whether it triggers from a move route or an event command. And the engine makes a new audio buffer for every SE, so overlap should not be an issue in any case.
For your second case: does the audio clip back in, or does it fade in? I imagine it'll clip if there is missing or invalid data. If it's fading in instead, that might suggest there's an anti-noise filter and/or dynamic range compression being applied by sources such as your system audio driver enhancements, a third-party app, or a plugin in your game.
Also, does the period of silence/quiet include all audio, or just this SE? Might help to narrow down the exact cause.
I fully realize this is a thread necro, but since this problem was never solved and it's my original thread on the topic, I believe it is okay to do per the forum rules
🙂.
First, my apologies on taking so long in replying to this thread, at the time I was just so busy I completely forgot about it.
So, long story short, I've never been able to fix this SE issue. I'd like to compile some more info in the hopes I can get some additional assistance in solving it.
To answer caethyril's questions: I believe the audio clips back in (to be honest i'm not entirely sure if I can audibly tell the difference, but it does sound more like a sudden jerk of sound. Still, it could be the sound fading in as its always the latter frames of the SE's being played). There is no other audio playing at the moment this occurs as it's meant to be a mostly silent event. There are other SE's that play earlier in the event, and they also sometimes clip. However, no particular sound
always clips, most of the time they play perfectly fine, so I don't think there is anything wrong with the SE files themselves.
Plugin wise, for more info, I believe the only sound related plugins I am using are the Visustella Core Engine and Tea Proximity Sound (although Tea++'s plugin isn't used anywhere in these events and is not running anything parallel on the map).
Edit: I would also like to point out that sometimes SEs do this exact effect in the Sound Test section of the editor.
Edit2: I am able to reliably replicate the SE bug in the Sound Test section by simply browsing the internet for about 5 minutes, opening up the Sound Test in RPG Maker MZ, and playing an SE. The first time an SE is played, it will always "glitch out" and only play the last 10 frames or so of the SE. It does seem to me like it's fading in the SE for whatever reason. I have no idea if this is related to SE's not properly playing in events, but perhaps?
Edit3: After a few hours of experimentation I have found a functional work-around for this bug. I can "pre-load" any SEs on a map (through an autorun event that plays all the SEs at 0 volume). This will result in the SEs no longer glitching out when they are played properly later in a cutscene, on the map, etc. I don't know the cause of this issue, but I suspect there is some sort of lag with how the RPG Maker MZ engine loads SEs the first time they are played on a map, and it can result in glitched out sound effects. By playing the SEs earlier on the map at 0 volume, the SEs are already loaded, and will play properly the next time they are called.
I don't want to report this issue as
solved to the mods just yet as it technically is not, I've simply found a functional work-around. So if anyone else may have insight on how to actually fix this bug, I would still greatly appreciate it
🙂. For now, I'll simply work with what I've got.