Ever wonder how the default RPG maker music loops? It's pretty simple, but in spite of looking I have never seen anyone explain it on the forums. RMMV (And AFAIK most other makers) are designed to read STARTLOOP and LOOPLENGTH tags in an audio files metadata. I'll be using a small piece of open source software I found on source forge called kid3 to edit the metadata and read the audio sample rate.
*Note; some audio filetypes use metadata tags differently. This tutorial may not work for every filetype - but it should work with OGG and M4A files at the very least.
Step 0 - Browse to your file in your metadata editor.
Step 1 - Note your Sample Rate (Hz).
Step 2 - Create a new Metadata Tag
Step 3 - It's important to name the frame ID "LOOPSTART" no quotations. As for the next window "text"; we will have to do some math - find the point in the song that should be the
beginning of your loop. You want the exact time to make the loop seamless. Convert that time to seconds. Multiply the number of second by your sample rate (I recommend using a calculator)

. The resulting number will be the value of the tag; aka, what you put in the "text" field.
In the example below - My sample rate is 44100 hz, and my loop starts at exactly 56 seconds. as a result - the LOOPSTART value was 2469600.
Step 4 - You now need to determine how long your loop will go for before starting again. Convert it to seconds, then multiply it by the sample rate. Create another tag, and call it "LOOPLENGTH", the input field should contain the result of the math done earlier in this step.
In the above example I wanted to loop the the rest of the song. The song is 2:20, so I took those 140 seconds, and deducted the 56 seconds before the loop started, leaving me with 84 seconds. 84 x my sample rate (44100) = 3704400.
Done. Don't forget to save, then throw it into RMMV as a BGM, and provided you got the times right - your music will loop seamlessly.
本贴来自国际rpgmaker官方论坛作者:Damaris处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/audio-looping-using-metadata-tags.74700/