OGG Music Looping?

In RPGMaker VX Ace, it was possible to loop OGG music files without playing the intro more than once by entering LOOPSTART, and LOOPLENGTH in the metadata. I assumed this would also be a thing in MV, however it doesn't seem that MV acknowledges this metadata at all.

Upon looking into this further, I've noticed that the music that comes with MV also has this metadata in place, meaning that it should work, right? Except it also seems that most, if not all of the default music doesn't even need the metadata in order to loop seemlessly, as none of the music has any sort of intro to skip. It's kind of important to me for this to work, as almost all of the music I plan on using has some sort of intro that should only play once.

I'd like to know if anyone else has noticed this yet. I've looked around, but haven't found anyone else mentioning the issue.
Ok this is serious problem !

I hope, we have new update about this.

Because some of my BGM is loopable in VXA and now not loopable in MV !?

Thanks for remind this.
Ok this is serious problem !

I hope, we have new update about this.

Because some of my BGM is loopable in VXA and now not loopable in MV !?

Thanks for remind this.
I checked the rpg_core.js, around line 7112 is where it reads this. So in my opinion:

a ) the tag is wrong (in the audio file) or

b ) the script is wrong.

WebAudio.prototype._readMetaData = function(array, index, size) { for (var i = index; i < index + size - 10; i++) { if (this._readFourCharacters(array, i) === 'LOOP') { var text = ''; while (array > 0) { text += String.fromCharCode(array[i++]); } if (text.match(/LOOPSTART=([0-9]+)/)) { this._loopStart = parseInt(RegExp.$1); } if (text.match(/LOOPLENGTH=([0-9]+)/)) { this._loopLength = parseInt(RegExp.$1); } if (text == 'LOOPSTART' || text == 'LOOPLENGTH') { var text2 = ''; i += 16; while (array > 0) { text2 += String.fromCharCode(array[i++]); } if (text == 'LOOPSTART') { this._loopStart = parseInt(text2); } else { this._loopLength = parseInt(text2); } } } }};The files shipped with MV have these tags LOOP and LOOPLENGTH (if you download mp3tag, the tags are Extended tags.) 

The loops are set on their playback settings

WebAudio.prototype._createNodes = function() { var context = WebAudio._context; this._sourceNode = context.createBufferSource(); this._sourceNode.buffer = this._buffer; this._sourceNode.loopStart = this._loopStart; this._sourceNode.loopEnd = this._loopStart + this._loopLength; this._sourceNode.playbackRate.value = this._pitch; this._gainNode = context.createGain(); this._gainNode.gain.value = this._volume; this._pannerNode = context.createPanner(); this._pannerNode.panningModel = 'equalpower'; this._updatePanner();};So.... it does look like it's working as designed? Does someone have a looped file that they are consciously aware of where it loops and isn't working?
I'm check with my music is does not working.

you can check with this file.

Credit to ryu lee music.
I'm check with my music is does not working.

you can check with this file.

Credit to ryu lee music.
OK, so I went and threw some debug code in and it looks like the script is setting Loop start to zero

Code:
rpg_core.js:7203 LOOPSTART set to 529137rpg_core.js:6990 onXhrLoad LS:529137 LL:0rpg_core.js:6998 onXhrLoad.onload LS:0 LL:77.12558333333334rpg_core.js:7035 _createNodes: LOOPSTART=0 LOOPLENGTH=77.12558333333334
I've been converting my midis into .oggs and have them loop perfectly with LOOPSTART and LOOPLENGTH values in the file.
I've been converting my midis into .oggs and have them loop perfectly with LOOPSTART and LOOPLENGTH values in the file.
The tag has be be spelled correctly.

 


I'm check with my music is does not working.

you can check with this file.

Credit to ryu lee music.

 
The OGG in question has the LOOPLENGTH spelled wrong. I noticed it when I compared it to one of MV's like about a minute ago after I added more debug code to the script and noticed that LOOPLENGTH was being skipped over.
I don't get it all...

but i hope they are fix this in next update.
I don't get it all...

but i hope they are fix this in next update.
There is nothing to fix, the problem is the ogg file.

34988l0.png


If I correct it, the console log shows it processes it correctly:

rpg_core.js:7209 LOOPLENGTH set to 2871919rpg_core.js:7205 LOOPSTART set to 529137rpg_core.js:7225 LOOPSTART set to 529137rpg_core.js:7226 LOOPLENGTH set to 2871919rpg_core.js:7227 exit _readMetaDatarpg_core.js:6990 onXhrLoad LS:529137 LL:2871919rpg_core.js:6992 LoopLength of 2871919 is non-zerorpg_core.js:7000 onXhrLoad.onload LS:11.998571428571429 LL:65.1228798185941rpg_core.js:7037 _createNodes: LOOPSTART=11.998571428571429 LOOPLENGTH=65.1228798185941Fixed file
Wow thanks !

anyway, what's the program to see the meta data ?

The previous files is work fine in VXA.
Wow thanks !

anyway, what's the program to see the meta data ?

The previous files is work fine in VXA.
It's called mp3tag http://www.mp3tag.de/en/download.html
Okay, I'm not entirely sure I understand. I've tried quite a lot of music tracks that don't seem to acknowledge LOOPSTART, and LOOPLENGTH.

Here's a picture of the Metadata as seen in Audacity. (The same file loops in VXAce perfectly fine.) - http://imgur.com/wuJA2Vr
 

(I'm not sure if I'm allowed to upload the file itself or not, since it's not my own original music)
If you want to download the javascript I made to dump debugging information about loading the sounds click here, copy the file over the rpg_core.js in the deployed game and press F8 in it, click console (if testing from RMMV) or edit package.json set "toolbar": true, and hit the menu button on the right, and open the developer console.

If LOOPLENGTH is spelled LOOPLENGTH and LOOPSTART is greater than zero, then it loops as expected. If LOOPLENGTH is mis-spelled as LOOPLENGHT then doesn't set it at all.

Field1 that comes with RMMV has looping settings.
Okay, this is very intriguing to me. I did as you say, and it says that LOOPSTART, and LOOPLENGTH are set to 0. But why would that be happening, if, according to audacity, and RMVXAce the metadata is correct?

I'm not really that smart when it comes to scripting and such, so I really don't have the first idea of where to begin figuring this out.
Okay, this is very intriguing to me. I did as you say, and it says that LOOPSTART, and LOOPLENGTH are set to 0. But why would that be happening, if, according to audacity, and RMVXAce the metadata is correct?

I'm not really that smart when it comes to scripting and such, so I really don't have the first idea of where to begin figuring this out.
If you load it into mp3tag, extended tags, you should see LOOPSTART and LOOPLENGTH measured in samples. So a 44100 sample rate * 2 seconds would be 88200. What the WebAudio loader is doing is dividing the loopstart and looplength by the sample rate at load time. 

Hence seeing

LOOPSTART=11.998571428571429 LOOPLENGTH=65.1228798185941Since that is the number divided by the sample rate. 

The first time the audio file is played, it's played from the beginning, but when it gets to the loopstart+looplength position it then loops back to the loopstart position.
Alright, well I kind of understand.
 

I somehow managed to fix the issue on my own, though I still don't really know why what I did worked. In audacity, I removed all the metadata inside audacity, arranging the list exactly like Field1.

Example: http://imgur.com/F7GAzry

For some reason, this worked. I've tried it on a few music tracks now, and they all loop perfectly. You were the one who inspired me to screw around with it, so thank you for the help.

I guess this means the issue is solved, but I've got one last question: Do you know why this worked?
(Necroposting instead of starting a thread myself!  Mods, if you're gonna blueline me, just go ahead and do it. But isn't it better to necropost an old thread than to waste space on a new one? >_<;;; )


I hope this gets fixed in an update... I'm not well versed in coding at all and most of these instructions seem pretty daunting to me. Are we expected to code voodoo our ways to loopable music that before, had an intro and perfect execution back to the point of the loop?
I'm just so confused...  



I figured it out... 
RMMV loop music works, just clear all stuff inside Audacity in Edit Metadata 🙂
This could be my new project Anime X Earth Bound (Also known as Mother in Japanese or "Anime Kurosu Mother")
Kudos baby XD

Original thread: https://forums.rpgmakerweb.com/threads/ogg-music-looping.47158/