MV Check current position of bgm

Is there a built in way to check what position the bgm currently playing is at? If not, is there a plugin that lets me do it? I want to have something that's basically this pseudocode:

Code:
var position = AudioManager.checkPos()
AudioManager.playBGM("new BGM", position)

Any help would be appreciated!
Try something like this:
JavaScript:
AudioManager.playBgm({
    name: 'disco11',
    volume: 50,
    pitch: 100,
    pan: 0
}, AudioManager._bgmBuffer.seek());
Remember that code is case-sensitive!
That worked! Thank you so much!

Is there a way to also apply fadein or no?
Great!

To fade out the current BGM, you can use the Fadeout BGM event command.

To fade in the new BGM, you can add a line to the end of the script call I suggested:
JavaScript:
AudioManager._bgmBuffer.fadeIn(1);
I.e. "fade in the BGM over 1 second" - replace the 1 with whatever value you like.

So the final event might look like this:

◆Fadeout BGM:1 second ◆Wait:60 frames ◆Script:AudioManager.playBgm({ : : name: "Battle3", : : volume: 4, : : pitch: 100, : : pan: 0 : :}, AudioManager._bgmBuffer.seek()); : :AudioManager._bgmBuffer.fadeIn(1);
If you want cross-fade instead (i.e. fade in new track while old one is fading out) then I'd suggest looking for a plugin, since by default there's only 1 BGM buffer. Maybe this one?

Original thread: https://forums.rpgmakerweb.com/threads/check-current-position-of-bgm.172874/