It's easy to edit metadata in OGG files using Ex Falso or even Winamp.
Spoiler: Example
tag: title
value: The Imp's Song
tag: artist
value: Bobby Prince
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
tag: loop_start
value: 00h00m29.549s
tag: loop_finish
value: 00h01m34.638s
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.
Re: OGG loop metadata
Posted: Wed Jun 30, 2010 6:39 pm
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.
Re: OGG loop metadata
Posted: Wed Jun 30, 2010 6:39 pm
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.
Re: OGG loop metadata
Posted: Wed Jun 30, 2010 6:51 pm
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.
Re: OGG loop metadata
Posted: Wed Jun 30, 2010 10:07 pm
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.
Re: OGG loop metadata
Posted: Wed Jun 30, 2010 10:18 pm
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.
Re: OGG loop metadata
Posted: Wed Jun 30, 2010 10:35 pm
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.
Re: OGG loop metadata
Posted: Thu Jul 01, 2010 12:00 am
by randi
It does. Were you under the mistaken impression that FMOD can't do loop points?
Re: OGG loop metadata
Posted: Thu Jul 01, 2010 12:16 am
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.
Re: OGG loop metadata
Posted: Fri Jul 09, 2010 9:02 pm
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.
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?
Re: OGG loop metadata
Posted: Mon Jul 19, 2010 1:31 pm
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.
Re: OGG loop metadata
Posted: Mon Jul 19, 2010 1:49 pm
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.
Re: OGG loop metadata
Posted: Mon Jul 19, 2010 8:00 pm
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.
Re: OGG loop metadata
Posted: Mon Jul 19, 2010 9:16 pm
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... ?