Are there any plugins that let you save the exact time of a song (bgm) thats playing in a variable, and subsequently, let you start another song at the exact time saved in that variable? If there aren't any, is that something simple that can be made?
MV Save the time a song is at in a variable
JS Plugin RequestsBump
Bump
Bump
Hello, @Peva As $gameVariable can only store an integer number(as I tested it),
I'm going to save the current play time in AudioManager._currentSaveBgmTime so you can use it later.
I'm going to save the current play time in AudioManager._currentSaveBgmTime so you can use it later.
JavaScript:
AudioManager._currentSaveBgmTime = AudioManager._bgmBuffer.seek();
var saveBgmTime = AudioManager._currentSaveBgmTime;
var newBgm = { name: filename, volume: n, pitch: n, pan: n }
AudioManager.playBgm(newBgm, saveBgmTime);
To save the exact time of the currently playing song (bgm) in a variable and restart next time, the following worked.
Save the current number of seconds in variable 1 while fading out the playing bgm.
$gameVariables.setValue(1,AudioManager.saveBgm())
Play from the last number of seconds from next time AudioManager.replayBgm($gameVariables.value(1));
Is this what you are looking for?
Save the current number of seconds in variable 1 while fading out the playing bgm.
$gameVariables.setValue(1,AudioManager.saveBgm())
Play from the last number of seconds from next time AudioManager.replayBgm($gameVariables.value(1));
Is this what you are looking for?
Sorry, just to confirm, do I just run these as "script" in the event editor?
yes it is in my case
first do it in script
Examples:
AudioManager.stopBgm()
$gameVariables.setValue(1,AudioManager.saveBgm())
then at a time of your choosing
AudioManager.replayBgm($gameVariables.value(1));
first do it in script
Examples:
AudioManager.stopBgm()
$gameVariables.setValue(1,AudioManager.saveBgm())
then at a time of your choosing
AudioManager.replayBgm($gameVariables.value(1));
Original thread: https://forums.rpgmakerweb.com/threads/save-the-time-a-song-is-at-in-a-variable.150105/