Hi, I'm attempting to create a plugin that will swap a currently playing audio track with another track that is arranged to be very similar (identical in length and tempo) to make some dynamic music changes. I'm currently able to do as I want, by saving the current music track's position before the buffer gets cleared and playing the other music track with that saved position.
However, doing it this way creates a very short, but noticeable "gap" where nothing is playing since the AudioManager needs to stop the first buffer before creating the second one and slightly throws off the rhythm. I would've preferred to just be able to switch the currently playing audio buffer's loaded track so that the audio continues playing without stopping at all. I've been looking through the source code including the AudioManager and WebAudio classes but can't seem to find how exactly RPG Maker actually loads or stores the audio file beyond using the createBuffer function and a URL. Swapping the URL alone doesn't change the buffer's track, and I tried using the private ._load(url) function to no avail. Maybe I'm not understanding something here.
My main question then, is it possible within RPG Maker to change the track of a currently playing audio buffer to have a seamless switch to a different audio file without pausing or stopping, or should I just stick with what I've already implemented even if it has a small hiccup?
However, doing it this way creates a very short, but noticeable "gap" where nothing is playing since the AudioManager needs to stop the first buffer before creating the second one and slightly throws off the rhythm. I would've preferred to just be able to switch the currently playing audio buffer's loaded track so that the audio continues playing without stopping at all. I've been looking through the source code including the AudioManager and WebAudio classes but can't seem to find how exactly RPG Maker actually loads or stores the audio file beyond using the createBuffer function and a URL. Swapping the URL alone doesn't change the buffer's track, and I tried using the private ._load(url) function to no avail. Maybe I'm not understanding something here.
My main question then, is it possible within RPG Maker to change the track of a currently playing audio buffer to have a seamless switch to a different audio file without pausing or stopping, or should I just stick with what I've already implemented even if it has a small hiccup?