Various sound questions

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
The Ultimate DooMer
Posts: 2109
Joined: Tue Jul 15, 2003 5:29 pm
Location: Industrial Zone

Various sound questions

Post by The Ultimate DooMer »

Having discovered the benefits and limitations of Sonic emulation, here come the questions:

Does ZDoom support 44KHz 16 bit sounds? (as I'm being forced into using them)

If so, do they sound exactly the same in-game as they do out of it? (as I know ZDoom is set to 22KHz or something)

Do mp3's play exactly the same in-game as wavs do? (as I'll have to use them if I'm using 44KHz)

What's the best bitrate to use for mp3's? (I've tried 160kbps so far and it seems to be fine, but are there any better ones?)

What's your opinion on having sounds of such varying quality (ie. the 11KHz 8 bit sounds of DooM 2, the 22KHz 8 bit sounds from LTSD and the 44KHz 16 bit Sonic sounds) together in the same wad? Do you think it's alright, or do you think the contrast in quality affects the game at all?

(btw, I haven't started the long editing process to create the individual sounds yet - I only have them grouped in big wav files - so that's why I haven't tested them myself)
User avatar
Chris
Posts: 2969
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Post by Chris »

Yes you can use 44khz 16bit sounds. For a bitrate, I'd say 128kbps would be enough, especially if it's mono samples.

As for varying quality. I could live with it, since ZDoom(or rather, fmod) tries to resample the lower quality sounds with higher quality output, although it still could be noticeable depending on the sample. A lo-fi cymbal crash and a hi-fi woman scream would sound out of place, imo.
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Post by randi »

Don't use MP3 for your samples. Use Ogg Vorbis or FLAC instead (because they're free, not because MP3 won't work). ZDoom supports 8- and 16-bit samples at any frequency (including odd ones like 8363 Hz). The varying quality should be fine. I doubt anyone will notice unless they're specifically looking for it.
User avatar
The Ultimate DooMer
Posts: 2109
Joined: Tue Jul 15, 2003 5:29 pm
Location: Industrial Zone

Post by The Ultimate DooMer »

Well, I've just used MP3 and Flac on the same sample and the MP3 (128Kbps) was 4 times smaller than the flac....and last time I tried Ogg, the sound was all corrupted in the game, so I guess I know which one to use.... (I have a lot of sounds, so size is everything, especially when I have to use 44KHz)
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Post by randi »

ZDoom handles Ogg Vorbis sound effects fine. I was using it to compress most of the sounds in zdoom.wad before I added FLAC support, so try again.

FLAC is bigger than MP3 because it is lossless, which is essential when you want to compress looping sounds. If you compress a looping sound with a lossy codec like MP3 or Vorbis, the end points of the waveform could move and no longer loop seemlessly.
User avatar
The Ultimate DooMer
Posts: 2109
Joined: Tue Jul 15, 2003 5:29 pm
Location: Industrial Zone

Post by The Ultimate DooMer »

Just tried the Oggdrop XPD (I used the plain one last time) and it works fine, with the file slightly smaller than the MP3, so that looks the best bet for most sounds.

By looping sounds, I presume you mean the ones used for continuous ambient sounds? I do have some of those, but not too many (most are from LTSD, hence 22KHz), so I could use Flac on those and Ogg on the rest (as I assume the looping sounds would be screwed if I used Ogg).
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Post by randi »

Yes, looping sounds are the ones that don't end. I think Vorbis might be better about not moving sample endpoints than MP3, but I'm not sure, and FLAC will definitely keep them intact. Even if the endpoints do move with Vorbis, it might not be enough to really be noticable, so you can try it with both Vorbis and FLAC and decide which one you like better.
User avatar
Enjay
 
 
Posts: 26945
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Post by Enjay »

As a matter of interest, how does the size of a zipped WAD with WAV samples in it compare with one with MP3/OGG/FLAC in it? I'd assume that the WAD itself would be much bigger with WAVs, but they would be able to be compressed more with an archive program. A compressed sound format will not compress much further when using an archive program (such as winzip) so the final resulting zip size might be much the same.

So, my real question is, if the reason you are compressing the files is to keep things small for distribution, does using compression on the sounds offer any download size advantage over leaving the WAD to use big WAV files and just zipping it up using a good archiver?

Or is there another factor - like Zdoom working quicker with the compressed sound lumps or something?
User avatar
The Ultimate DooMer
Posts: 2109
Joined: Tue Jul 15, 2003 5:29 pm
Location: Industrial Zone

Post by The Ultimate DooMer »

I put 4 versions of the same sample into a zip (wav, mp3, ogg, flac) and they all compressed with similar (crappy) ratios. But the compressed sound file is much smaller than the original wav (which are even bigger now I'm using 44KHz), so the zip will be smaller with oggs instead of wavs.

I used WinZip 6.3 with max compression (probably outdated now as I've used it for years), which archivers can zip wav files better?
Last edited by The Ultimate DooMer on Sat Sep 06, 2003 5:47 pm, edited 1 time in total.
User avatar
Enjay
 
 
Posts: 26945
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Post by Enjay »

Well, my version of Winzip is 8.1 and there is no reason not to upgrade because if you have registered, then your registration is valid for newer versions, if you haven't, then you still just get the same reminders you always did (I think - mine is registered so I don't see the nag screens).

I have no idea if the compression ratio is any better with 8.1 though. I usually use "maximum" when I zip things up, but I am always reading things like "Winzip is crappy, try X". I know that when I tried Power Archiver to make cab files, they were usually significantly smaller than zip files made with winzip. I don't know whether Power Archiver would do any better with the zip format than Winzip though.

Files have to be in Zip format before Ty will accept them in the archives IIRC.
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Post by randi »

A compressor designed specifically for sounds will almost always compress sounds better than a general purpose compression utility like zip. By means of example, here are the results with a large wav file (48 Khz, 16 bit, stereo):

Original: 47,523,884 bytes
zip -9: 45,563,977 bytes (4.1% smaller)
flac -8: 31,343,913 bytes (34% smaller)

FLAC does a much better job because it takes advantage of the special properties of sound data. ZIP knows nothing about sounds and barely compresses it at all. So compressing sounds individually in a wad instead of relying on zip to reduce their size is a good idea.

[FLAC is used in this comparison because it's lossless, just like zip.]
User avatar
Enjay
 
 
Posts: 26945
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Post by Enjay »

randy wrote:Original: 47,523,884 bytes
zip -9: 45,563,977 bytes (4.1% smaller)
flac -8: 31,343,913 bytes (34% smaller)
Hmmm, a significant difference right enough.
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Post by wildweasel »

Hmm...

For FM/chip samples like Ultimate Doomer is using (sounds from Sonic games), I'd use 44 khz, 8-bit mono in MP3 or OGG formats.

As for compressors, I've been using WinRAR for a few years now and it's got better ZIP compression than most....
User avatar
Hirogen2
Posts: 2033
Joined: Sat Jul 19, 2003 6:15 am
Operating System Version (Optional): Tumbleweed x64
Graphics Processor: Intel with Vulkan/Metal Support
Location: Central Germany
Contact:

Post by Hirogen2 »

Weird that FLAC (Linux version, Source) does not handle 11KHz sounds.
Using oggenc -q -1 now :)
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Post by randi »

To make FLAC work with 11 kHz sounds, you must add the --lax parameter to the command line. This is because the flac tool's default behavior is to only produce "Subset files." These are files that are guaranteed to be Internet-streamable by a properly written FLAC decoder. But flac will actually work with any sample rate if you let it produce non-Subset files by using --lax.

You should also add --no-padding to flac's command line to save a few more killobytes. The flac tool's default behavior is to write 4096 bytes of padding to the file for reasons I'm not clear on.
Locked

Return to “Editing (Archive)”