Posts: 2,507
Threads: 75
Joined: Dec 2010
Hey DerVV, I've found a solution for you.
RPG Maker XP seems to take EXACTLY 0.5 seconds to load a track. At least, on my PC that is, this may vary, I don't know.
My point being, I can introduce 0.5 seconds of silence before a track and then get them to load one after the other then STILL be synced for playback.
Question:
Does your script load the mp3s in order of their channel? So channel 1 will load before channel 2? If not, is this a possibility? It would mean it loads the track with the silence before it loads the track without it, therefore always playing the music in sync.
Also...
My problem now is that when it loops, it reloads each time them so my timing falls out of place significantly. Is there a way to keep the tracks loaded and just play them over and over? This would prevent there being a second loading period, and a third etc.
I can fix this by manually looping every time and turning off your looping system I guess. Sadly, this doesn't seem to work. I used "BGM_End_Loop" but it didn't stop looping.
So, any ideas how to improve on this? :)
Posts: 11,238
Threads: 649
Joined: May 2009
In regards of your loop delay/sync problem, something must have been disturbed. The system only loads the files once. Once it reaches the loop point, the audio track merely replays from the other point while it is already loaded. It doesn't perform an OPEN command to reload it.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
Above are clickable links
Posts: 2,507
Threads: 75
Joined: Dec 2010
Oh right... Then I must have done something wrong. ^^
Thanks.
Posts: 27
Threads: 7
Joined: May 2009
Hi. I have a question.
I wonder if it is possible to use hash and array instead of case-when for setting loop point.
Like:
Code: {'filename' => [start, loop, finish']}
Posts: 400
Threads: 13
Joined: Mar 2010
I actually have done that myself. Here are bits of the Game_System area:
PHP Code: <?php
class Game_System
def bgm_data
data = {
"Battle2" => [60, 22180, 127830],
}
data.default = [0,0,0]
return data
end
PHP Code: <?php
# BGM Every setting
if bgm != nil and bgm.name != ''
if bgm_data.include?(bgm.name)
start = bgm_data[bgm.name][0]
loop = bgm_data[bgm.name][1]
fin = bgm_data[bgm.name][2]
end
I also made some extra changes to be able to start a song where I define, which I am yet to work out how to make the song continue after battle. I just need to be able to get the current position. PHP Code: <?php
def bgm_play(bgm, channel=1, startpoint = 0)
PHP Code: <?php
fin = bgm_data[bgm.name][2]
end
start = startpoint if startpoint != 0
Posts: 552
Threads: 35
Joined: Oct 2010
This is cool. I can have an air conditioner sound and people talking and a train all in one map.
Derp.
Alot of audio work I am doing right now.
Posts: 11,238
Threads: 649
Joined: May 2009
Bump
to version 1.2
I figured out a method to let you alter the starting point in Ogg Vorbis music files. It required an additional parameter that I call an Ogg Offset. Weird... but usable. And the editor had been set up to handle it. But I totally forgot you need to install a codex to hear Ogg files when your PC normally can't.
And the audio system now lets you play Midi music using both my system and RPGMaker XP's own default system. As such, the editor had been tweaked to let you flag which Midi pieces may perform that way. Granted, there are negative issues playing midi music using the default audio system 'combined' with music using this one.
And now accompanying the system are two more files, one being a helluva help file while the other is a codex installation file so people unable to play .ogg files can at least play them with this system.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
Above are clickable links
Posts: 14
Threads: 4
Joined: Feb 2016
Sledgehammer bump: This is something I've always have been looking for, the ability to loop a BGM that doesn't require cutting off the intro part. The script works effortlessly, however I wouldn't be posting here if it was without some compatibility issue. Of all the scripts I have, the one that seems to have issue is the Vehicle System script created by yours truly DerVVulfman. Just to be sure I installed the Audio Module script onto the Vehicle demo project to see if it might've been another script causing compatibility problem, however it seems like the two doesn't like each other.
Link to thread: https://www.save-point.org/thread-2554.h...cle+system
Problems:
Just by entering a vehicle would cause a script error. If I was to assume what the problem is, it would be the Vehicle script trying to play the audio assigned to the vehicle which somehow has compatibility problem with the Audio Module script.
Another one is for some reason by having these two scripts together it causes a script error with Save Files, even newly fresh ones after installing the scripts. Having a game where one's Save File being unable to be load due to script error is totally no fun.
Posts: 11,238
Threads: 649
Joined: May 2009
Did you check 'script order' ?
The Audio Module Rewrite mcisendstring performs a rewrite and overhaul of the audio system. So it would take precedent over the original audio system.
As such, it would be best to have Audio Module Rewrite mcisendstring high up in your list of custom scripts while other scripts which would access or play any audio would be best placed further below.
Other than that, it would be requested to supply the actual error message generated as well as the actual line (if any configuration changes affects the line numbering).
(Currently typing at work... away from my PC with em')
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
Above are clickable links
Posts: 14
Threads: 4
Joined: Feb 2016
(04-18-2020, 06:11 PM)DerVVulfman Wrote: Did you check 'script order' ?
The Audio Module Rewrite mcisendstring performs a rewrite and overhaul of the audio system. So it would take precedent over the original audio system.
As such, it would be best to have Audio Module Rewrite mcisendstring high up in your list of custom scripts while other scripts which would access or play any audio would be best placed further below.
Other than that, it would be requested to supply the actual error message generated as well as the actual line (if any configuration changes affects the line numbering).
(Currently typing at work... away from my PC with em')
I have tried rearranging the script order by having the Audio Module scripts on the top followed by the scripts for the Vehicle System and the result has not changed unfortunately. I am using the both scripts system from the demo project completely untouched.
As for the error messages, there are three I have managed to produce.
This message is given when entering a Vehicle.
Code: Script '* Vehicles' line 1291: NoMethodError occurred.
undefined method `name' for {1=> nil, 2=> nil, 3=> nil}:Hash
and the line number of the script:
Code: n = value_name.name
The second message is given when loading a save file on a map with a BGM playing.
Code: Script '* Audio Class Rewrite' line 1063: NoMethodError occurred.
undefined method `name' for #<Hash:0x3f07048>
and the line number of the script:
Code: passed = true unless Audio.bgm_check(channel) == "Audio/BGM/" + bgm.name
The third message is given when loading a save file on a map without a BGM playing.
Code: Script '* Audio Class Rewrite' line 1063: NoMethodError occurred.
undefined method `name' for {1=> nil, 2=> nil, 3=> nil}:Hash
The line of the script should be the same as the one above.
|