These are not rejected - but are not considered highly important right now.
Moderator: GZDoom Developers
- Posts: 17805
- Joined: Fri Jul 06, 2007 3:22 pm
Okay, here's a proposal. As you know, the [wiki]IMF[/wiki] format does not allow to define the sample rate. ZDoom uses 700 hz for everything, but there are files that have a rate of 560 hz or 280 hz instead. This is occasionally a problem
I suggest a way to solve this by tweaking a bit Martin Fernandez' header format. The header currently is as such:
Code: Select all
char Signature (must be ADLIB)
uint8 Version (must be 1 — this format has no other version)
char* Track name as a null-terminated string
char* Game name as a null-terminated string
byte Ignored unknown value, generally 1
uint32 Track length (if 0: until end of file or null instruction)
It could be modified as such while keeping backward compatibility:
Code: Select all
char Signature, unchanged
uint8 Version — 2
char* Track name, unchanged
char* Game name, unchanged
byte sample rate / 7 (so 40 for 280 hz, 80 for 560 hz, or 100 for 700 hz)
uint32 Track length, unchanged
If version is 1, keep using a fixed rate of 700. Code impact on ZDoom would be minimal. Editing tool support would happen pretty soon in SLADE 3. What do you think?
- Posts: 272
- Joined: Wed Apr 11, 2012 10:31 am
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10 Pro 21H1
- Graphics Processor: nVidia with Vulkan support
- Location: St. Louis, MO
I'm sold on this idea, just as long as it maintains backwards compatibility, as you said.
- Posts: 1953
- Joined: Mon Dec 17, 2012 11:08 am
- Location: Here, stupid.
All my yes.
TAKE ALL OF MY YES
- Posts: 3124
- Joined: Wed Nov 24, 2004 12:59 pm
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
Editing someone else's header seems a little risky to me. I wonder if a safer solution would be to detect based on the game name? Possibly also support some string there like "Generic: 700Hz"? The plus side is that existing playback utilities would continue to play the files.
- Posts: 5886
- Joined: Tue Jul 19, 2005 9:06 pm
- Location: New Zealand
Alt idea the third: A $imfrate <lump> <rate> parameter introduced in [wiki]SNDINFO[/wiki]? From what I can tell, most IMFs need volume balancing anyway, so you already need an SNDINFO entry for them.
- Lead GZDoom+Raze Developer
- Posts: 48879
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Do people actually use these formats? I don't, I do not even have any of them lying around so someone else will have to do this.