[RMVX ACE] STARTING BGM AT CERTAIN POINT IN THE SONG
Posts
Pages:
1
Okay, I've been trying to figure this one out for about a week now. Basically, I have an ogg file that at certain points when triggered, I want it to start at a predefined point that is not the beginning, and not something saved from previous gameplay. And sometimes this start point will be changed depending upon which event it was triggered in.
I thought I found a script answer in the form of, but no matter what number I set startpoint to, it always starts at the beginning (unless I make the number large enough to crash the game, but that's not what I'm after here).
So, what do I do?
I thought I found a script answer in the form of
Audio.bgm_play('Audio/BGM/songname', 100, 100, startpoint);So, what do I do?
It does work, you just need an appropriate value in there. The position feels like a sample number but as far as I can tell it isn't a 1:1 correlation. For example try this script command:
and it'll skip the first couple seconds or so of the Battle1 theme. If you want to see the current position of what's play you can use:
to print it to the console to try and find that point where you want your music start.
Audio.bgm_play('Audio/BGM/Battle1', 100, 100, 1430240)
and it'll skip the first couple seconds or so of the Battle1 theme. If you want to see the current position of what's play you can use:
print "BGM Pos: #{RPG::BGM.last.pos}\n"
to print it to the console to try and find that point where you want your music start.
Alright, it seems using the print to console thing to get the position number is able to produce numbers that work when put into the script thing later.
It turns out, for some weird reason, the sample numbers in audacity are actually 4 times smaller than the ones in vx ace. So any time I want something to start at a specific point and my sample numbers are sourced from audacity, I have to multiply the result by 4 to get the same point in vx ace.
Thank you for giving me a solid way forwards on this one.
It turns out, for some weird reason, the sample numbers in audacity are actually 4 times smaller than the ones in vx ace. So any time I want something to start at a specific point and my sample numbers are sourced from audacity, I have to multiply the result by 4 to get the same point in vx ace.
Thank you for giving me a solid way forwards on this one.
Pages:
1
















