EthanFox

Veteran
Veteran
Joined
Oct 15, 2018
Messages
551
Reaction score
352
First Language
English
Primarily Uses
RMMV
Hey, sorry to post about this here but I have an issue with this plugin and have no means to contact Irina (the itchio page doesn't have a comment section or any contact info).

I've found that if you use this plugin, and use a scripted statement saying:

Play BGM: "None"

(which I at times use to stop BGM)

When you run the game, later (only after deployment), you'll get an error - a "can not find file" error, where it'll say it's looking for "bgm/.ogg", meaning it's literally looking for a file with a blank name rather than registering that this is just a blank file.

1620935352107.png
 

WilsonE7

Veteran
Veteran
Joined
Oct 12, 2019
Messages
87
Reaction score
39
First Language
English
Primarily Uses
RMMZ
Same. I just used an audio program (Audacity) to generate a silence track and named it "None" to get the same effect. Fading out the BGM for 1 sec has similar, but not the same, results.
 

EthanFox

Veteran
Veteran
Joined
Oct 15, 2018
Messages
551
Reaction score
352
First Language
English
Primarily Uses
RMMV
Same. I just used an audio program (Audacity) to generate a silence track and named it "None" to get the same effect. Fading out the BGM for 1 sec has similar, but not the same, results.

I considered that, but I'm at a late stage of testing and don't want to change how I've approached many of my events, even in a way that should work.

I was hoping this would just "slot in" but that was asking too much.
 

A-kun

boop the snoot
Member
Joined
Jan 30, 2021
Messages
21
Reaction score
7
First Language
English (US)
Primarily Uses
RMMV
Hey, sorry to post about this here but I have an issue with this plugin and have no means to contact Irina (the itchio page doesn't have a comment section or any contact info).

I've found that if you use this plugin, and use a scripted statement saying:

Play BGM: "None"

(which I at times use to stop BGM)

When you run the game, later (only after deployment), you'll get an error - a "can not find file" error, where it'll say it's looking for "bgm/.ogg", meaning it's literally looking for a file with a blank name rather than registering that this is just a blank file.

View attachment 189208
You use "Play BGM: None" instead of "Fadeout BGM"? Why?
If you set the frames for the fadeout duration to one, it's instantaneous.

Edit: I realize you both have already touched on this, but if you really want to keep doing it this way, which I don't recommend but I won't stop you, I can suggest another plugin I'm using that's an alternative to this. I've had my own issues with Irena's Anti Audio Delay plugin, and ever since switching, I haven't had any problems, well, save for one... I'm getting off topic, though.
 

EthanFox

Veteran
Veteran
Joined
Oct 15, 2018
Messages
551
Reaction score
352
First Language
English
Primarily Uses
RMMV
You use "Play BGM: None" instead of "Fadeout BGM"? Why?

Mainly because I did it that way and it worked, so I really don't want to change it.

My game is ~10 hours long, and as a VN, it's heavy on the cutscenes and dialogue; at this stage I'm only making changes where that's totally unavoidable.

EDIT: Also, I considered the plugin you linked, but was put off by the bugs people mention in the thread.
 

Zero_G

Veteran
Veteran
Joined
Mar 28, 2020
Messages
86
Reaction score
54
First Language
English
Primarily Uses
RMVXA
Make a plugin out of this and test if it works.

JavaScript:
var ZERO_AudioManager_playBgm = AudioManager.playBgm;
AudioManager.playBgm = function(bgm, pos) {
    if(bgm.name == ''){
        this.stopBgm();
        return;
    }
 
    ZERO_AudioManager_playBgm.apply(this, arguments);
};
 
Last edited:

EthanFox

Veteran
Veteran
Joined
Oct 15, 2018
Messages
551
Reaction score
352
First Language
English
Primarily Uses
RMMV
Make a plugin out of this and test if it works.

JavaScript:
var ZERO_AudioManager_playBgm = AudioManager.playBgm;
AudioManager.playBgm = function(bgm, pos) {
    if(bgm.name == ''){
        this.stopBgm();
        return;
    }

    ZERO_AudioManager_playBgm.apply(this, arguments);
};
Should this go above or below Irina's plugin? Or does that even matter?
 

Zero_G

Veteran
Veteran
Joined
Mar 28, 2020
Messages
86
Reaction score
54
First Language
English
Primarily Uses
RMVXA
Should this go above or below Irina's plugin? Or does that even matter?
Most probably below

EDIT:
OK, tested my previous script and it wasn't working, here is a proper fix (use attached v2 script), put it below Irina's plugin.

If for any reason it doesn't work (it's working on my side) or causes other problems, I can tell you which line to modify in Irina's plugin.

Two things I don't really know:
- I'm calling an abrupt stop in AudioManager.createBuffer when the name variable is empty, only for bgm folder, I could have done this out of the switch, for every sound, but I don't really know if it will break something else.
(EDIT: Edited Script for every sound)
- I'm returning nothing in AudioManager.createBuffer, a more elegant way would be to return an empty WebAudio in case another part of the program is expecting it, but I don't really know how to do that. So if anything breaks it's probably this. (EDIT: This is false, MV expects a null, and an empty WebAudio gives errors).

Regarding this fix, you could stop Irina's plugin from trying to enter createBuffer when name is empty (as MV orginal scripts do), but then it breaks somewhere else.
But with this fix it probably won't break anything when calling a none/empty audio. I think another line is checking if the cache is null and that's why this is working.

Only for bgm sounds.
JavaScript:
(function() {
    ZERO_AudioManager_createBuffer = AudioManager.createBuffer;
    AudioManager.createBuffer = function(folder, name) {
        switch (folder) {
            case 'bgm':
            if(name === '') return;
            this._audioCacheBgm = this._audioCacheBgm || {};
            var cache = this._audioCacheBgm;
            break;
            case 'bgs':
            this._audioCacheBgs = this._audioCacheBgs || {};
            var cache = this._audioCacheBgs;
            break;
            case 'me':
            this._audioCacheMe = this._audioCacheMe || {};
            var cache = this._audioCacheMe;
            break;
            case 'se':
            this._audioCacheSe = this._audioCacheSe || {};
            var cache = this._audioCacheSe;
            break;
            default:
            return ZERO_AudioManager_createBuffer.call(this);
        }
        if (!cache[name]) {
            cache[name] = ZERO_AudioManager_createBuffer.call(this, folder, name);
        }
        return cache[name];
    };
})();
 

Attachments

  • Irina_AntiAudioDelay_fix_v2.js
    257 bytes · Views: 2
Last edited:

EthanFox

Veteran
Veteran
Joined
Oct 15, 2018
Messages
551
Reaction score
352
First Language
English
Primarily Uses
RMMV
Most probably below

EDIT:
OK, tested my previous script and it wasn't working, here is a proper fix (use attached v2 script), put it below Irina's plugin.

If for any reason it doesn't work (it's working on my side) or causes other problems, I can tell you which line to modify in Irina's plugin.

Two things I don't really know:
- I'm calling an abrupt stop in AudioManager.createBuffer when the name variable is empty, only for bgm folder, I could have done this out of the switch, for every sound, but I don't really know if it will break something else.
(EDIT: Edited Script for every sound)
- I'm returning nothing in AudioManager.createBuffer, a more elegant way would be to return an empty WebAudio in case another part of the program is expecting it, but I don't really know how to do that. So if anything breaks it's probably this. (EDIT: This is false, MV expects a null, and an empty WebAudio gives errors).

Regarding this fix, you could stop Irina's plugin from trying to enter createBuffer when name is empty (as MV orginal scripts do), but then it breaks somewhere else.
But with this fix it probably won't break anything when calling a none/empty audio. I think another line is checking if the cache is null and that's why this is working.

Only for bgm sounds.
JavaScript:
(function() {
    ZERO_AudioManager_createBuffer = AudioManager.createBuffer;
    AudioManager.createBuffer = function(folder, name) {
        switch (folder) {
            case 'bgm':
            if(name === '') return;
            this._audioCacheBgm = this._audioCacheBgm || {};
            var cache = this._audioCacheBgm;
            break;
            case 'bgs':
            this._audioCacheBgs = this._audioCacheBgs || {};
            var cache = this._audioCacheBgs;
            break;
            case 'me':
            this._audioCacheMe = this._audioCacheMe || {};
            var cache = this._audioCacheMe;
            break;
            case 'se':
            this._audioCacheSe = this._audioCacheSe || {};
            var cache = this._audioCacheSe;
            break;
            default:
            return ZERO_AudioManager_createBuffer.call(this);
        }
        if (!cache[name]) {
            cache[name] = ZERO_AudioManager_createBuffer.call(this, folder, name);
        }
        return cache[name];
    };
})();
Thanks! I'll give this a try.
 

EthanFox

Veteran
Veteran
Joined
Oct 15, 2018
Messages
551
Reaction score
352
First Language
English
Primarily Uses
RMMV
Thanks all, but I've ultimately decided not to use the plugin. It works, and @Zero_G 's snippet did fix my problem.

However, when using it, interspersed throughout my game I'm getting strange instances of SFX "clipping", like where an effect doesn't fully play, and cuts off suddenly in the middle of the sample. When I disable the plugin, this doesn't happen. I suspect this is something to do with playing multiple instances of the same sample only a few seconds apart, so it's trying to cache a sample while the same named one is playing? But that's just a theory.

Ultimately my game's performance was never that bad, so I'm just going to shelve it. But I would still recommend it to others if you're starting a new project. I just can't rework all my cutscenes at this late stage of mine.
 

Latest Threads

Latest Profile Posts

When there's a will, there's a lifehack. :ninja:

Before i mess with battle UI further, does it look decent enough? :hswt:
Free MZ? That's good. I should go try it out then.
Let's see if I can make it in time xD
Knipsel.PNG

Forum statistics

Threads
112,523
Messages
1,068,912
Members
146,205
Latest member
mchirinos
Top