by Gez » Sat Sep 12, 2015 9:29 am
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[5] 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[5] 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?
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 [url=http://forum.zdoom.org/viewtopic.php?f=4&t=49538]a problem[/url].
I suggest a way to solve this by tweaking a bit Martin Fernandez' header format. The header currently is as such:
[code]char[5] 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) [/code]
It could be modified as such while keeping backward compatibility:
[code]char[5] 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 [/code]
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?