[Added] OGG loop metadata

Moderator: GZDoom Developers

OGG loop metadata

Postby Cleveland Rock » Wed Jun 30, 2010 6:28 pm

It's easy to edit metadata in OGG files using Ex Falso or even Winamp.

Spoiler: Example


Why not have ZDoom read metadata for loop points when available instead of looping the whole song? As far as I know, the only way to add such metadata is manually.

Spoiler: Example


Although I only use OGG audio, it might be worthwhile to suggest this feature for other formats, as well; especially MP3s, which don't normally loop properly. Various games by Valve use WAV audio, and their methods for looping WAV files is documented here.

Alternately, you could make a "LOOPDEFS" lump to define loop points in audio.
Cleveland Rock
 
Joined: 25 Oct 2006
Location: Cleveland, OH

Re: OGG loop metadata

Postby Ceeb » Wed Jun 30, 2010 6:39 pm

Cleveland Rock wrote:Alternately, you could make a "LOOPDEFS" lump to define loop points in audio.


I would like to say I support this particular idea. Most of ZDoom's lumps try to be human-readable, easy to use text, and so this would be an (for the modder anyway) easy solution.
User avatar
Ceeb
Official Idoit Of ZDoom
Banned User
 
Joined: 11 Jun 2008
Location: Castle Wut

Re: OGG loop metadata

Postby edward850 » Wed Jun 30, 2010 6:39 pm

edward850, in the previous thread wrote:The problem is not only finding a digital audio format that supports loop points, but also making sure Fmod supports it (which in most cases, it doesn't). One could get crafty and store the loop data in an external file, or in the extended data of an OGG, but it's utterly useless if Fmod doesn't use it.
User avatar
edward850
[netcode intensifies]
 
Joined: 19 Jul 2005
Location: New Zealand

Re: OGG loop metadata

Postby NeuralStunner » Wed Jun 30, 2010 6:51 pm

Actually several of ZDoom's supported music formats are handled by the engine, not FMod. Thanks to that, raw OPL (DRO) was recently added, I think.
User avatar
NeuralStunner
Not "Neutral"
 
 
 
Joined: 21 Jul 2009
Location: capital N, capital S, no space
Discord: NeuralStunner#4201
Operating System: Windows Vista/7/2008 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Re: OGG loop metadata

Postby randi » Wed Jun 30, 2010 10:07 pm

Cleveland Rock wrote:It's easy to edit metadata in OGG files using Ex Falso or even Winamp.

You forgot foobar2000. :)

edward850 wrote:but also making sure [FMOD] supports it (which in most cases, it doesn't)

Errr... Rrrrrriiiggghhhttttt...

FYI, I can set any loop points I want, including overriding whatever might be embedded in the file already.

NeuralStunner wrote:raw OPL (DRO) was recently added, I think.

It's been around for quite a while now. What was added recently was support for DROs produced by the current version of DOSBox, since it's completely incompatible with the old format.
User avatar
randi
Site Admin
 
Joined: 09 Jul 2003

Re: OGG loop metadata

Postby Xaser » Wed Jun 30, 2010 10:18 pm

A bit off-topic, but I never was able to find a good reason for the format change in the discussions I've read. Why'd they change it entirely, anyway?

A more pressing question, I suppose, is how the devil to actually export .DROs, since the recording controls don't seem to work at all for me. :?
User avatar
Xaser
anarchivist
 
 
 
Joined: 20 Jul 2003

Re: OGG loop metadata

Postby edward850 » Wed Jun 30, 2010 10:35 pm

randy wrote:FYI, I can set any loop points I want, including overriding whatever might be embedded in the file already.

Really? I always figured Fmod handled the playback of OGG in zdoom.
User avatar
edward850
[netcode intensifies]
 
Joined: 19 Jul 2005
Location: New Zealand

Re: OGG loop metadata

Postby randi » Thu Jul 01, 2010 12:00 am

It does. Were you under the mistaken impression that FMOD can't do loop points?
User avatar
randi
Site Admin
 
Joined: 09 Jul 2003

Re: OGG loop metadata

Postby edward850 » Thu Jul 01, 2010 12:16 am

When I was told that FMOD didn't have that much control over the actual playback (ie, it can do loop points, but only if the format its playing back supports it). Guess I should double check information like that.
User avatar
edward850
[netcode intensifies]
 
Joined: 19 Jul 2005
Location: New Zealand

Re: OGG loop metadata

Postby randi » Fri Jul 09, 2010 9:02 pm

Added. The tags are "LOOP_START" and "LOOP_END". Your example file should be tagged as follows:

LOOP_START = :29.549
LOOP_END = 1:34.638

They can also contain PCM values rather than times by just giving them as single integers without any punctuation.

See my commit message for more details.
User avatar
randi
Site Admin
 
Joined: 09 Jul 2003

Re: OGG loop metadata

Postby Gez » Mon Jul 19, 2010 10:45 am

I am intrigued by this:
Sounds that define a loop no longer play looped by default. They must be started with CHAN_LOOP so that the higher level sound code knows they loop and can handle them accordingly.


Does that mean that if they are not played through an A_PlaySound call (but, for example, they're the level music as assigned in MAPINFO), then they won't loop?
Gez
 
 
 
Joined: 06 Jul 2007

Re: OGG loop metadata

Postby Zippy » Mon Jul 19, 2010 1:31 pm

Wait, wait... if the change only applies to OGG's which include a special tag for looping, won't it then always loop as level music (if the tags are properly defined)? It sounds like the scenario you're defining is one where the user somehow invoked the new behavior without setting a loop point in the OGG tags which... shouldn't be possible.

Unless... are we talking all sounds, wavs et al.? In that case I do see the problem in undercutting the old assumption of building the loop into the file always looping. I think the actual case is that "OGG files with LOOP tags won't loop when played as sounds (not music) unless started with CHAN_LOOP," by virtue of the fact that it seems to make the most sense.
User avatar
Zippy
Your Golden Boy
 
Joined: 23 Mar 2005
Location: New Jersey
Discord: Zurock#4834

Re: OGG loop metadata

Postby NeuralStunner » Mon Jul 19, 2010 1:49 pm

Zippy wrote:I think the actual case is that "OGG files with LOOP tags won't loop when played as sounds (not music) unless started with CHAN_LOOP," by virtue of the fact that it seems to make the most sense.
That was the impression I got, as well.
User avatar
NeuralStunner
Not "Neutral"
 
 
 
Joined: 21 Jul 2009
Location: capital N, capital S, no space
Discord: NeuralStunner#4201
Operating System: Windows Vista/7/2008 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Re: OGG loop metadata

Postby randi » Mon Jul 19, 2010 8:00 pm

Gez wrote:Does that mean that if they are not played through an A_PlaySound call (but, for example, they're the level music as assigned in MAPINFO), then they won't loop?

I wrote "sounds", not "music", so it only applies to sound effects. Level music is still always looped.
Zippy wrote:Are we talking all sounds, wavs et al.? In that case I do see the problem in undercutting the old assumption of building the loop into the file always looping.

What? People did that and expected it to work? I can only remember people wondering why their sound effects were looping. It never worked 100% properly. If people actually use it, then I'll need to do some more rewriting to make it a properly supported feature. I figured I could just take the easy way out and rely on the modder to specify it explicitly.

To further expound on this, the LOOP_START and LOOP_END tags will work with any sound format (other than MP3) that supports custom tags. (I believe this is only Vorbis and FLAC, but I could be wrong.) For sound effects, you can also use the LOOP_BIDI tag to create bidirectional "ping-pong" loops.
User avatar
randi
Site Admin
 
Joined: 09 Jul 2003

Re: OGG loop metadata

Postby Zippy » Mon Jul 19, 2010 9:16 pm

randy wrote:
Zippy wrote:Are we talking all sounds, wavs et al.? In that case I do see the problem in undercutting the old assumption of building the loop into the file always looping.

What? People did that and expected it to work? I can only remember people wondering why their sound effects were looping. It never worked 100% properly. If people actually use it, then I'll need to do some more rewriting to make it a properly supported feature. I figured I could just take the easy way out and rely on the modder to specify it explicitly.
I never did it. I was always annoyed with having to do it when editing for Half-Life as it seemed to me if the sound effect needed to loop I should just be able to tell the engine that when it plays it should loop. I was assuming though that if people were accidentally running into ZDoom looping their cue pointed files, then it must have been fully supported (by FMOD or whatever). It is telling that there isn't much mention of it outside of those accidental instances though. So... I guess the answer is... no... ?
User avatar
Zippy
Your Golden Boy
 
Joined: 23 Mar 2005
Location: New Jersey
Discord: Zurock#4834

Next

Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 0 guests