OGG loop metadata

Moderator: GZDoom Developers

Cleveland Rock
Posts: 26
Joined: Wed Oct 25, 2006 6:36 pm
Location: Cleveland, OH

OGG loop metadata

Post by Cleveland Rock »

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.
User avatar
Ceeb
Posts: 5125
Joined: Wed Jun 11, 2008 4:07 pm
Location: Castle Wut

Re: OGG loop metadata

Post by Ceeb »

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
edward850
Posts: 5886
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand

Re: OGG loop metadata

Post by edward850 »

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
NeuralStunner
 
 
Posts: 12301
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)
Location: capital N, capital S, no space

Re: OGG loop metadata

Post by NeuralStunner »

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
randi
Site Admin
Posts: 7731
Joined: Wed Jul 09, 2003 10:30 pm

Re: OGG loop metadata

Post by randi »

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
Xaser
 
 
Posts: 10771
Joined: Sun Jul 20, 2003 12:15 pm

Re: OGG loop metadata

Post by Xaser »

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
edward850
Posts: 5886
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand

Re: OGG loop metadata

Post by edward850 »

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
randi
Site Admin
Posts: 7731
Joined: Wed Jul 09, 2003 10:30 pm

Re: OGG loop metadata

Post by randi »

It does. Were you under the mistaken impression that FMOD can't do loop points?
User avatar
edward850
Posts: 5886
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand

Re: OGG loop metadata

Post by edward850 »

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
randi
Site Admin
Posts: 7731
Joined: Wed Jul 09, 2003 10:30 pm

Re: OGG loop metadata

Post by randi »

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.
Gez
 
 
Posts: 17688
Joined: Fri Jul 06, 2007 3:22 pm

Re: OGG loop metadata

Post by Gez »

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 [wiki]A_PlaySound[/wiki] call (but, for example, they're the level music as assigned in MAPINFO), then they won't loop?
User avatar
Zippy
Posts: 3302
Joined: Wed Mar 23, 2005 5:31 pm
Location: New Jersey

Re: OGG loop metadata

Post by Zippy »

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
NeuralStunner
 
 
Posts: 12301
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)
Location: capital N, capital S, no space

Re: OGG loop metadata

Post by NeuralStunner »

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
randi
Site Admin
Posts: 7731
Joined: Wed Jul 09, 2003 10:30 pm

Re: OGG loop metadata

Post by randi »

Gez wrote:Does that mean that if they are not played through an [wiki]A_PlaySound[/wiki] 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
Zippy
Posts: 3302
Joined: Wed Mar 23, 2005 5:31 pm
Location: New Jersey

Re: OGG loop metadata

Post by Zippy »

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... ?

Return to “Closed Feature Suggestions [GZDoom]”