OGG: Support for "loop_start" and "loop_end" (for streaming music in Doom ports)

Started by Lollie,

Lollie

Hi all! I have a very niche feature request, everyone's favorite kind.

I've occasionally had to fiddle with looping OGGs — one of the more common reasons has been for Doom ports. I've only just learned of XMPlay, and pairing it with the "OGG Tag Support" plugin has given me a much easier way to edit Vorbis metadata, which I'm very happy to have.

XMPlay natively supports "loopstart" and "looplength" just fine, but Doom ports rely on "loop_start" and "loop_end" instead. It's apparently been this way for ZDoom since 2010, and ports like Chocolate Doom, PrBoom+, and Nightdive's recent "Doom I + II" re-release all support them too. Even the Duke Nukem 3D port "EDuke32" has gotten in on the action.

(Additionally: Doom ports also support looping FLACs using the same tags. I've yet to check if XMPlay supports looping FLACs.)

I will note, this is a bigger ask than it sounds on the surface. To lay out the differences, citing ZDoom Wiki:
  • In XMPlay, "loopstart" and "looplength" only accept sample positions. In Doom ports, "loop_start" and "loop_end" can be a sample position OR a timecode in the mutable format of 00:00:00.000 (HH:MM:SS.sss), accurate to one millisecond.
  • In XMPlay, "looplength" is a duration, and is offset by "loopstart" if present. In Doom ports, "loop_end" is just a straight sample/timecode.
  • In order to determine whether a value is a sample or a timecode, ZDoom checks whether a colon ( : ) is present. "44100" would be parsed as a sample position, while "0:01", ":01.0", "0:01.000", and any other variations would all be parsed as timecodes.
  • If a tag's value contains anything other than 0-9, more than two colons, or more than one decimal ( . ), it is ignored.

With all that said: What are the chances of having these tags recognized in XMPlay?

Ian @ un4seen

Here's an update for you to try:

    www.un4seen.com/stuff/xmplay.exe

The "timecode" stuff is untested as I don't have any test files for that, so please let me know if there's any problem with it, and if so, upload an affected file to have a look at here:

    ftp://ftp.un4seen.com/incoming/

If all is well, I'll look into adding support in the FLAC plugin too (it doesn't currently support looping).

Lollie

Oh wicked, thank you! These tags work perfectly fine with samples.

Timecodes don't seem to do anything right now, so I've just uploaded a zip called "Timecode Loop Tests.zip" to the FTP. It's just a basic test tune, set up with timecodes in a few different forms. It should loop between 0:05 and 0:17.

Ian @ un4seen

Thanks for the test files. Here's another update to get the timecodes working too:

   www.un4seen.com/stuff/xmplay.exe

Let me know if there's still any problem with it.

Lollie

As far as I can tell, it works perfectly! I've tried every different form of timecode that I can think of, and they all work as expected. Thank you so much!

Ian @ un4seen

Good to hear it's working well. Here now is a FLAC plugin update that should have the same looping support:

    www.un4seen.com/stuff/xmp-flac.dll

Let me know if you see any problem with it.