VOGONS

Common searches


Question about Wave files

Topic actions

First post, by Stojke

User metadata
Rank l33t
Rank
l33t

Hey guys. Does any one know more than just basic stuff about wave files?

I am wondering how did game makers from 90s and early 2000s manage to get high quality and low file size.
Mainly things like duke nukem, where every voice is 20kB maximum.

I also wonder does any one know any names for Wave compilation disks? I am sure those existed. They used to sell all kinds of crap, png images, models, other media on CDs. I am sure some one sold wave samples.

I know that by lowering sampling frequency and bit depth i can reduce file size, but the final product is very noisy and messy. I am sure they used some kind of processing.
I also wonder what programs could have they used than?

Thankful a lot for any info.

Note | LLSID | "Big boobs are important!"

Reply 1 of 38, by Mau1wurf1977

User metadata
Rank l33t++
Rank
l33t++

These factors determine file size of a WAV file:

- Length of recording (time)
- Bit depth (How precise each sample is measured)
- Sample rate in Hz or kHz (How many samples per second are taken)
- Channels (MONO or Stereo)

So if we go with something typical of MS-DOS games:

- 8 kHz sample rate
- 8 bit
- MONO

You get a storage requirement of:
8000 x 8 / second which are 64000 bit per second which are 7.8 kilobyte per second.

My website with reviews, demos, drivers, tutorials and more...
My YouTube channel

Reply 2 of 38, by mr_bigmouth_502

User metadata
Rank Oldbie
Rank
Oldbie

I wondered the same thing about videos for a long time. It turns out that a low resolution and bitrate can be acceptable if they are used right.

Reply 3 of 38, by leileilol

User metadata
Rank l33t++
Rank
l33t++

Duke3D used VOC. Also their khz was painfully low (ranging from 5998hz to 8800hz, and sometimes 10989hz if you're lucky. The freeze sound and the whistling are the only high quality sounds.

apsosig.png
long live PCem

Reply 4 of 38, by Stojke

User metadata
Rank l33t
Rank
l33t

I understand that more now, thanks. But isn't there any other trick they used? Something to get the files less noisy.

I have some samples here, all small file size, but sound great and very little noise:
https://dl.dropboxusercontent.com/u/54462712/ … /WaveExample.7z

Well, duke was my first thought, since i remember it having very small file size sounds. But thats still pretty acceptable.

Note | LLSID | "Big boobs are important!"

Reply 5 of 38, by Jorpho

User metadata
Rank l33t++
Rank
l33t++

Of course, there were compression algorithms back then as well, even though none of them were anywhere near as good as MP3 – µ-law and ADPCM and such. The SNES used a form of the latter known as BRR. Many of the codecs should still be included in Windows.

Reply 6 of 38, by Stojke

User metadata
Rank l33t
Rank
l33t

I see, just like many formats today.

But, is there a way to prepare the WAV file for compression in order to get a best sounding sample?
Just like when compressing an large image you get better smaller image than compressing an slightly bigger image to that size (example 100% => 10% is better than 20% => 10% in quality).

I need normal WAVE files to use them in my Counter Strike 1.6 maps (Half Life engine [Gold Source]). It doesn't support compression.

Note | LLSID | "Big boobs are important!"

Reply 7 of 38, by Jorpho

User metadata
Rank l33t++
Rank
l33t++
Stojke wrote:

Just like when compressing an large image you get better smaller image than compressing an slightly bigger image to that size (example 100% => 10% is better than 20% => 10% in quality).

This is news to me.

Stojke wrote:

I need normal WAVE files to use them in my Counter Strike 1.6 maps (Half Life engine [Gold Source]). It doesn't support compression.

Are you quite sure about that? Not unlike a .avi file, a .wav file is just a container that supports a wide variety of different compression methods, even MP3. You should check whether the original files use compression or not.

Even if they're not compressed, why would you want to compress them? Hard drive space is plentiful and data transfer rates are quick, and some form of compression (even if it's just .zip) will probably end up applied to them anyway no matter how the samples get transferred. Are you just trying to challenge yourself to see how small you can make everything?

Reply 8 of 38, by Stojke

User metadata
Rank l33t
Rank
l33t
Jorpho wrote:

This is news to me.

Well, thats from my experience with working >500 px pixtures into 96x96. Larger pictures retain more shape and quality than scale down from lets say 150px.

Jorpho wrote:

Even if they're not compressed, why would you want to compress them? Hard drive space is plentiful and data transfer rates are quick, and some form of compression (even if it's just .zip) will probably end up applied to them anyway no matter how the samples get transferred. Are you just trying to challenge yourself to see how small you can make everything?

Because CS server transfer rate is limited to 56k 😁
And it takes a hell lot of time to transfer all the resources. Lucky servers use fast download, but many are afraid to experiment with maps. Fast download servers are quite costly.

And yes, i like to challenge my self. I always have loved retro 3D scenes in games such as Half Life, Unreal Tournament 99, Lara Croft Tomb Raider, and so on.
Textures are pretty straight forward, their size in pixels defines their size in kB. Except when an image is having more dithering and colors of course.
But wav files are something i yet dont know much about.

And I'm 100% sure it uses Microsoft PCM Wave, Constant bit rate, mono channel.

Note | LLSID | "Big boobs are important!"

Reply 9 of 38, by DracoNihil

User metadata
Rank Oldbie
Rank
Oldbie

Speaking of wave files, I wish there was a simple tool to insert sampler chunk data into any RIFF WAV file... I'd write one myself but finding solid info on all the different things I can write is proving to be a hassle and I'm lazy...

There are various games out there that make use of sampler chunk data to have looping wav files or sustain loops. Descent 3 is one of these, Fallout 3 is another. Unreal also does support loop data but cannot unloop a sound in progress. (i.e. it stays playing _forever_ until you go out of hearing distance, it is culled by too many sounds playing at once, or a sound plays over the SLOT it's playing on)

“I am the dragon without a name…”
― Κυνικός Δράκων

Reply 10 of 38, by leileilol

User metadata
Rank l33t++
Rank
l33t++

CoolEdit 95/96 can do that. Quake is the earliest game to make use of it (to my knowledge) and it is what id Software used.

On PC, ADPCM was really used far later in the 90s when things were phasing away from CD audio for music and MP3 licensing was still too expensive. SiN and GTA2 are nice ADPCM game examples. Quake3 has bits of ADPCM decoding in the code, but never was actually used.

Of course there's also to mention the support for compressed sounds in the earlier SB cards... though i can't name a bunch of games that used it off the top of my head.

apsosig.png
long live PCem

Reply 11 of 38, by VileR

User metadata
Rank l33t
Rank
l33t
Stojke wrote:

I know that by lowering sampling frequency and bit depth i can reduce file size, but the final product is very noisy and messy. I am sure they used some kind of processing.
I also wonder what programs could have they used than?

Yep, that's quantization noise for you. Funny thing is, I could swear that when I did it back then with old software ON the old hardware (e.g. w/ "Blaster Master" on the SB16, as recently mentioned by rfnagel), downsampling/bit depth reduction yielded far better results than what I hear when I do the same these days.

Part of that is probably a rose-colored rear view mirror. The other part is, I wasn't dealing with very high sample rates or bit depths in the source material to begin with.

[ WEB ] - [ BLOG ] - [ TUBE ] - [ CODE ]

Reply 12 of 38, by SarahWalker

User metadata
Rank Member
Rank
Member
leileilol wrote:

Of course there's also to mention the support for compressed sounds in the earlier SB cards... though i can't name a bunch of games that used it off the top of my head.

Oddly enough, Duke Nukem 2 makes heavy use of hardware ADPCM. Can't think of anything else that does though.

Reply 13 of 38, by Stojke

User metadata
Rank l33t
Rank
l33t

I see.
Half Life (gold source) engine has support for cue points for track looping. It will play the part of the track until it reaches a cue point, from there it will loop. But it can be stopped.

Can you tell me more how does old sound hardware have an influence in this? And what applications did you use?
I have a few old cards, such as: SB16, AWE64G, SW1000XG.

And thanks for the info leileilol, that gives me enough material to google for things.

Note | LLSID | "Big boobs are important!"

Reply 14 of 38, by m1so

User metadata
Rank Member
Rank
Member
VileRancour wrote:

Yep, that's quantization noise for you. Funny thing is, I could swear that when I did it back then with old software ON the old hardware (e.g. w/ "Blaster Master" on the SB16, as recently mentioned by rfnagel), downsampling/bit depth reduction yielded far better results than what I hear when I do the same these days.

Part of that is probably a rose-colored rear view mirror. The other part is, I wasn't dealing with very high sample rates or bit depths in the source material to begin with.

It is not "rose colored mirror", it is because low sample rates often sound much better without an antialiasing filter rather than with it. Antialiasing filters on modern soundcards filter out aliasing noise, but also mute all frequncies below half of the sample rate. So a 22 Khz file on a modern soundcard lacks any frequency above 11 Khz, resulting in a dull sound. The 22 Khz file played without filtering is full of aliasing noise above 11 Khz, but human ears don't generally recognise the exact content of high frequencies as long as they are there. So the aliased file often sounds better than the "proper" version. You can do this thing with a bitcrusher even in the present day.

Filtered low samplerate files sound dull, while unfiltered has a "metallic" sound to it, ranging from a nice "sparkle" at 22 Khz samplerate to a rough, metal junk sound typical of Sega Genesis samples at 4 Khz.

It is not black/white either. Many old samplers/soundcards had a filter, but not a one that completely elliminated all frequencies above the half of the sampling rate. The Amiga, SB Pro and the SP1200 sampler had one for example.

Quantization noise, well, it can be lessned very much by dynamic compression. My bitcrusher experiments yeilded me a listenable file at 4-bit when used on popular music, given the loudness war makes most modern releases already compressed as fuck. Dithering and noiseshaping also helps.

I'll upload and link some examples later.

Reply 15 of 38, by DracoNihil

User metadata
Rank Oldbie
Rank
Oldbie

CNC also used ADPCM for... well everything. All the voice acting, unit sounds and music were monoual IMA ADPCM stored in a unique chunked method Westwood Studios made for whatever reason.

Also my thought's on Quantization noise. I've actually had limited success using a noise gate to fix such occurrences though this really is with stupidly dithered 8-bit files.

I've done this to filter out the voices of the bots in Counter-Strike, the voices in NAM, and some other 8-bit wave files that had stupid dither applied to them... Why the hell is dithering such a "good idea" for 8-bit files? It sounds worse than it would without the dither applied.

I use Audacity for all my experiments with noise gating to cut out quantization noise.

“I am the dragon without a name…”
― Κυνικός Δράκων

Reply 16 of 38, by m1so

User metadata
Rank Member
Rank
Member

Because non-dithering creates horrible distortion, especially on fade-outs. Dynamic compression of the source material is far more effective than "noise gates", in my experience they make everything sound like shit, but then, I don't mind 8-bit noise much. I hope you don't save the files after applying the noise gate, it just reintroduces the quantization error.

EDIT - Here are the files I promised

http://www.fileswap.com/dl/HdPE0DibG/
http://www.fileswap.com/dl/c3oZiZ5o4z/
http://www.fileswap.com/dl/mWU3Dh5F6/
http://www.fileswap.com/dl/ZnSHMJmhe/
http://www.fileswap.com/dl/5eGHFmnoW/
http://www.fileswap.com/dl/I4U3BREhvp/
http://www.fileswap.com/dl/eqJ3Qheah/
http://www.fileswap.com/dl/BQDDc02bs/
http://www.fileswap.com/dl/8OEq1xOjwz/

The aliased files are exported as 44 Khz despite their low sample rate as modern software would filter them automatically, so I used the Time Machine in Audacity to reduce sample rate/bit depth (sample rates not exact, Time Machine has a "knob" interface). They are from a copyrighted song, but I believe 30 second clips to demonstrate technology constitute fair use.

In the 22 Khz unfiltered case, the files almost sound CD quality, with more of a metallic tone coming with 16 Khz and finally a strong metallic/ring modulation-like sounding effect at 8 Khz.

Note that to really hear the effect, you should download the files, the previews are heavily compressed.

Reply 17 of 38, by bloodbat

User metadata
Rank Oldbie
Rank
Oldbie

The 22 KHz unfiltered file sounds interesting and tricks the brain rather well (though it's not really near CD quality)...but the problem would probably lie in voices with no background: the human ear is too used to hearing those. A proper EQ could help eliminate some of the unwanted noise.

Reply 18 of 38, by m1so

User metadata
Rank Member
Rank
Member

Note that this is the "worst case scenario", with both AD and DA aliasing at 100 percent (adjustable in the settings). Most old computers would have a filter, but a relatively gentle one, not the strict one that most new computers have, and that is why for example Amiga mod music sounds so awesome despite most samples being around 16 Khz.

Equalizers and prepocessing also make a huge difference. Here is a converted iTunes file playing on a Tandy 1000SL at 22.05 Khz and 8-bit http://www.youtube.com/watch?v=akpErP5SYLc . The Tandy has a similiar "gentle" antialiasing filter that most old digital sound devices have.

As a side note, Emulator 2 had some of the most beautiful sounds ever and it only used 27.7 Khz sample rate and 8-bit DPCM sampling. It used special analog filters. Hear the awesomeness http://www.youtube.com/watch?v=DDxOhnL7pjs http://www.youtube.com/watch?v=6bF6OzySsR4 http://www.youtube.com/watch?v=-N1Bf24Rk5I http://www.youtube.com/watch?v=hinAv-PI32Y http://www.youtube.com/watch?v=-BM_S7DOn5A . You probably heard it if you ever listened to 80s music. And this is a relatively low quality Youtube recording.

Reply 19 of 38, by m1so

User metadata
Rank Member
Rank
Member

A MSX2 demo that plays Leila K at 14.5 Khz, 8-bit through the SCC chip... nice quality, especially considering the chip is a wavetable chip that usually cannot play samples longer than 32 bytes.

http://www.youtube.com/watch?v=AtfGyfWv_fc