Status
Not open for further replies.

Rink27

Veteran
Veteran
Joined
Jul 18, 2014
Messages
222
Reaction score
13
First Language
English
Primarily Uses
RMMV
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.
 
Last edited:

biud436

Veteran
Veteran
Joined
Sep 28, 2014
Messages
173
Reaction score
186
First Language
Korean
Primarily Uses
RMMV
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.
 

Rink27

Veteran
Veteran
Joined
Jul 18, 2014
Messages
222
Reaction score
13
First Language
English
Primarily Uses
RMMV
Thank you very much @biud436. I'd report the thread to be closed now.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,879
Reaction score
14,702
First Language
English
Primarily Uses
RMVXA

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.

 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

I got the pause Icon to use 6 frames instead of 4, PLUS it goes: top 1-2-3, bottom 1-2-3. And everything just by playing around with the code & i think i've figured the important parts out now <3
eUuH09A.gif

ps. the animation isn't as "wonky" in RL, stupid recording -.-
Friendly reminder: Make a back up of your project! ;3 I just did one and recognized I would have lost a week worth of work.
Why is there undo but not a redo like every other software in existence? :blink:
Chili: Evolved to taste spicy so no animal would eat them.

Humans: "Jokes on you ..."

Forum statistics

Threads
113,717
Messages
1,076,879
Members
147,742
Latest member
Rick21
Top