Pausing audio instead of stopping it?

Does anyone know a way to pause in the middle of an audio clip and then resume upon unpausing? I suppose freezing the entire game would also work.


You can stop audio outright, but I'd like to pause and then resume.


Thanks in advance!
event commands "save BGM" and "replay BGM", those will store the current position of the music and continue from there
event commands "save BGM" and "replay BGM", those will store the current position of the music and continue from there



That's good to know, but is there a similar command for SFX, even a js call?
Going to bump this because this is still an issue for me.


The script call for saving and replaying the BGM is as follows. Sadly, it doesn't work for SEs, though...


$gameSystem.saveBgm();



$gameSystem.replayBgm();
But SEs are supposed to be short, too short for these to make a difference... are you sure you are not thinking about BGSs?
But SEs are supposed to be short, too short for these to make a difference... are you sure you are not thinking about BGSs?



Possibly, but I don't believe there's a command to stop and replay BGSs either.


I'm trying to pause and resume narration.
Well, there is through scripts.


var bgs = AudioManager.saveBgs();
AudioManager.replayBgs(bgs);


should work, I think...
Well, there is through scripts.



var bgs = AudioManager.saveBgs();
AudioManager.replayBgs(bgs);


should work, I think...



Hmm, it doesn't seem to recognize that when I use it as a script command.


It gives me the error "bgs is not defined" when it attempts to resume the BGS.


Where should I be using it?
I assume you are doing this in an event so, in the script event command.
It gives me the error "bgs is not defined" when it attempts to resume the BGS.

Apparently, new variables declared in a script call (e.g. var bgs) are only accessible inside the same script.


Try storing the BGS in a game variable, like this:


$gameVariables.setValue(10, AudioManager.saveBgs()); // store the BGS in Variable #10


and resume like this:


AudioManager.replayBgs($gameVariables.value(10)); // resume the BGS stored in Variable #10




Not sure how to do this for Sound Effects, though - AudioManager.saveSe() doesn't seem to exist.
Sorry for necro, but I have a similar question and I'd like to avoid the scripting if possible. It's mostly because I have a lot of plugins and scripts written above don't work for me. The music never replays. At least it doesn't crash...
Here's what I do and what I receive.
Game_2017-08-03_21-29-10.png RPGMV_2017-08-03_21-28-25.png

Original thread: https://forums.rpgmakerweb.com/threads/pausing-audio-instead-of-stopping-it.69849/