How to store current BGM volume to a variable?

Hi!

I'm using an audio fader plugin that gives me lots of control over the volume of BGM. The issue is, if I fade BGM back in, that disregards the BGM volume level the player chooses in Options.

What would be the way to query the currently selected volume for BGM so I could abide by the player's wishes?

Thanks! :LZSgrin::LZSjoy::LZSgrin:
Try this:
Code:
var bgm = AudioManager._currentBgm;
$gameVariables.setValue(15, bgm);

Change 15 to the variable that you'd like to use.
Try this:
I don't think that will work - the _currentBgm member variable is of type AudioParameters, it's not just the volume.

You should be able to do
Code:
$gameVariables.setValue(15, AudioManager._bgmVolume);

or, going through the current BGM,
Code:
$gameVariables.setValue(15, AudioManager._currentBgm.volume);
I don't think that will work - the _currentBgm member variable is of type AudioParameters, it's not just the volume.

You should be able to do
Code:
$gameVariables.setValue(15, AudioManager._bgmVolume);

or, going through the current BGM,
Code:
$gameVariables.setValue(15, AudioManager._currentBgm.volume);
My mistake, I did not read the post properly. Thank you for correcting me.
I don't think that will work - the _currentBgm member variable is of type AudioParameters, it's not just the volume.

You should be able to do
Code:
$gameVariables.setValue(15, AudioManager._bgmVolume);

or, going through the current BGM,
Code:
$gameVariables.setValue(15, AudioManager._currentBgm.volume);

Got it, thank you very much!

Original thread: https://forums.rpgmakerweb.com/threads/how-to-store-current-bgm-volume-to-a-variable.149986/