Obtain Audio Filename

Hello. Is there a script command that can return the filename of the currently playing bgm/bgs/me?

Edit: I'm aware of $dataMap.bgm.name but there are songs that would not be called through map properties.
Here's the code that returns an audio file name :

Code:
AudioManager.getBgmFileName = function() {
  return this._currentBgm && this._bgmBuffer && this._currentBgm.name || "";
};

AudioManager.getBgsFileName = function() {
  return this._currentBgs && this._bgsBuffer && this._currentBgs.name || "";
};

AudioManager.getMeFileName = function() {
  if(!this._meBuffer) return "";
  var url = this._meBuffer._url;
  if(url.match(/(?:audio\/me\/)(.*).(?:ogg|m4a)/)) {
    return RegExp.$1;
  }
  return "";
};

if the audio buffer is valid, it will return its name. if not, it will return the empty string instead of its name.
Thank you very much @biud436. I'd report the thread to be closed now.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/obtain-audio-filename.82974/