Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: WAV Compression in SCMDraft2
WAV Compression in SCMDraft2
Jan 31 2011, 11:55 pm
By: Oh_Man  

Jan 31 2011, 11:55 pm Oh_Man Post #1

Find Me On Discord (Brood War UMS Community & Staredit Network)

When uploading sound to your map via SCMDraft 2, what is the difference between Low, Medium, & High Quality compression?

I mean the difference as in what bits, Hz, and does it change stereo to mono?

Thanks.




Feb 1 2011, 5:11 am Roy Post #2

An artist's depiction of an Extended Unit Death

I'm not sure. The compression never seems to affect the quality of the wav file on a noticeable scale when I use it, which leads me to believe it's just making it compress better inside the MPQ.

Also, I think SCMDraft's compression is the same as the original Staredit.exe's compression options. I don't have the resources to test this, however.

I'm almost certain it does not change stereo to mono.




Feb 1 2011, 5:12 am Jack Post #3

>be faceless void >mfw I have no face

You'd be best off compressing it yourself using audacity or some other audio editing program, then importing it without touching anything.



Red classic.

"In short, their absurdities are so extreme that it is painful even to quote them."

Feb 1 2011, 5:41 am Roy Post #4

An artist's depiction of an Extended Unit Death

Quote from Jack
You'd be best off compressing it yourself using audacity or some other audio editing program, then importing it without touching anything.
Actually, for best compression results, you want to compress the sound yourself (as a 16-bit) in addition to importing it using the editor's highest compression.

Quote from rockz
The smallest you should ever do is 16 bit, 8000 Hz. "decent" sound quality is at 16 bit, 11025 Hz. Since wav files are completely uncompressed, we can actually use the bitrate to calculate the size based on duration. 16 bit, 11025 Hz is 21.5 kB/s. 16 bit 8000 Hz is 15.6 kB/s. This adds up pretty fast, so a minute would be 1.26 MB, which might be far too much for your map.

Typically 16 bit audio compresses to less than 50% of its original size, which means it will be smaller than 8 bit audio inside the mpq.





Feb 1 2011, 6:50 am Jack Post #5

>be faceless void >mfw I have no face

Quote from Roy
[quote=name:Jack]You'd be best off compressing it yourself using audacity or some other audio editing program, then importing it without touching anything.
Actually, for best compression results, you want to compress the sound yourself (as a 16-bit) in addition to importing it using the editor's highest compression.

Depends on whether you care about end quality. See, if you compress using audacity, you can compress it to as low a quality as you're happy with, then stop. If you compress it further using SCMDraft, it'll be lower quality (and smaller, but there's the choice you have to make). You could use audacity and make a 100second clip something like 50 kbs but it'd be unrecognizable as the original clip because of how far you compressed it.



Red classic.

"In short, their absurdities are so extreme that it is painful even to quote them."

Feb 1 2011, 8:40 am Oh_Man Post #6

Find Me On Discord (Brood War UMS Community & Staredit Network)

Thanks for the answers so far guys.

Yeah well that is mainly what I was wondering, I am using Audacity to compress it now.

It gives me three options. Hz, bits, and mono/stereo.

6000Hz
8000Hz
11025Hz,
etc.

+ 8, 16, 24, 32 bits.

Does anyone know what the 'sweet spot' is between best compression and sound quality? Also, should I always compress to mono? I heard SC only plays mono anyway so stereo is just a waste of space?


See what I am doing is going through all my sound files in my map and swapping them out with higher compressed ones to keep the filesize down. I want to try and tell if there are files that are already compressed though, when I right click and go to properties, I get the following information:

Eg. of one.
Bit Rate: 705kpbs
Audio sample size: 16bit
Channels: 1 (mono)
Audio sample rate: 44 kHz
Audio format: PCM

Bit different...?




Feb 1 2011, 11:09 am NudeRaider Post #7

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Just to nitpick, the PCM wave format cannot be compressed. You can only reduce quality. You can use a compressor (like winzip, mpq, whatever) on it but then you have to decompress it during runtime. StarCraft decompresses mpq. This also makes pretty clear that the compression option in map editors can only mean mpq compression (lossless, but weak compared to mp3).

As for reducing quality with programs like audacity, this is entirely subjective.
For me anything below 22kHz is terrible, others think 8kHz is still acceptable.
You'll have to test for yourself what quality you deem acceptable for your map as it of course also depends on the audio file. With lower sampling rates high frequencies are just cut off. The highest frequency that can be heard in a wave file is half its sampling rate.

While audio files using 8 bit are 50% smaller than 16 bit without losing much quality they do not compress well in mpq. That's why it's almost always better to save the file in 16 bit.

StarCraft is capable of playing stereo sounds but since you can't tell sc where the wav is playing it's pointless. So stick to mono.

As you can you see, mono 16 bit is fixed so you only have to play around with sampling rate.

Post has been edited 1 time(s), last time on Feb 16 2011, 10:32 pm by NudeRaider.




Feb 1 2011, 2:32 pm rockz Post #8

ᴄʜᴇᴇsᴇ ɪᴛ!

Quote from wikipedia
# PKZIP (licensed from PKWARE). The first compression algorithm available.[citation needed]
# Huffman tree compression combined with ADPCM 4:1 compression (both introduced in StarCraft). Latter algorithm is lossy and only suitable for raw PCM input data.
It's lossy.

You can also input any sample rate you want, it's just that 8000 and 11025 are somewhat standard.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Feb 1 2011, 4:35 pm NudeRaider Post #9

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Ah makes sense. I always wondered how they'd achieve compression rates that good.
It also explains why 16 bit compresses better. The algorithm is optimized for it.




Feb 2 2011, 2:08 am Oh_Man Post #10

Find Me On Discord (Brood War UMS Community & Staredit Network)

Alright thanks for that.




Feb 16 2011, 12:08 pm NudeRaider Post #11

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Quote from name:private_parts
So interestingly enough, I compressed my four music files into 8000Hz, 16 bit, and mono - giving them a size of 4.1MB in total, and uploaded to SCMDraft with no compression. This made the size of my map 6mb. However, when I deleted and reuploaded with SCMDraft Highest compression, the size of my map was 3mb. :O

EDIT: Did further calculations and the compression brought those four sound files down from 4.1MB to 1.6MB. A remarkable reduction considering the loss of quality was not noticeable!

When getting into the game, I could not tell any difference in sound quality. :O

Have I caught on to something here? It seems like Highest Compression should always be used!
I'm not sure what you're getting at. I always use highest compression, and yes it makes the sounds smaller than the original wavs. That's the mpq compression.




Feb 16 2011, 3:24 pm Oh_Man Post #12

Find Me On Discord (Brood War UMS Community & Staredit Network)

Ah well there was some confusion at first as to whether all the compression could be done via Audacity. If high compression has no drawbacks why is there even an option for it? I would think it should be the only option or at least the default.




Feb 16 2011, 5:38 pm NudeRaider Post #13

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Because it is lossy (this part of my above statement was wrong), as rockz explained. Even though you might not hear the difference it is there. Compare with high mp3 resolutions.
Besides, you're already using a very bad quality audio file, maybe the compression is not as audible in those. (Just a theory)

And no, you can't do the mpq compression with Audacity because you can't compress PCM wavs. Well you can compress them but then they are not compliant to the wave standard anymore and won't work in your map. Sorry if I made it look like like you could apply the mpq compression in Audacity. The mpq compression will solely be managed by StarCraft and the map editor.




Feb 16 2011, 9:45 pm rockz Post #14

ᴄʜᴇᴇsᴇ ɪᴛ!

well the "compression" you do in audacity is downsampling the audio (8000 Hz 16 bit vs 44100 Hz 32 bit). It's lossy compression, though I don't know if we can really call it compression, since the file is permanently and significantly altered. Lossy compression (like mp3) uses a combination of techniques which damage the original data, but still retain most of the quality, as well as use actual lossless compression algorithms.

mpq compression is like mp3 compression but with significantly worse results, though due to the low quality of the audio, you usually can't tell.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Feb 16 2011, 10:34 pm NudeRaider Post #15

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Quote from rockz
well the "compression" you do in audacity is downsampling the audio (8000 Hz 16 bit vs 44100 Hz 32 bit). It's lossy compression, though I don't know if we can really call it compression, since the file is permanently and significantly altered.
That's why I'm making this distinction:
Quote
the PCM wave format cannot be compressed. You can only reduce quality.
To make clear this is a completely different process (although for the same purpose).




Feb 17 2011, 2:45 am Oh_Man Post #16

Find Me On Discord (Brood War UMS Community & Staredit Network)

Ah OK well thanks for this information. I've gone and compressed all the rest of my audio (spell effects, ambience, etc.) and have brought the size down to 2.94MB. My map is 500KB without any sound so I think I have struck a good balance with filesize and quality.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[12:52 pm]
Vrael -- if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
[11:17 am]
Zycorax -- :wob:
[2024-4-27. : 9:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
[2024-4-27. : 7:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
[2024-4-27. : 6:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
[2024-4-27. : 3:33 pm]
O)FaRTy1billion[MM] -- o sen is back
[2024-4-27. : 1:53 am]
Ultraviolet -- :lol:
[2024-4-26. : 6:51 pm]
Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
[2024-4-26. : 6:50 pm]
NudeRaider -- Vrael
Vrael shouted: Idk, I was looking more for a dehumidifer company which maybe stands out as a beacon of relief amidst damp and unpredictable climates of bustling metropolises. Not sure Amazon qualifies
sounds like moisture control is often a pressing concern in your city
[2024-4-26. : 6:50 pm]
Vrael -- Maybe here on the StarEdit Network I could look through the Forums for some Introductions to people who care about the Topics of Dehumidifiers and Carpet Cleaning?
Please log in to shout.


Members Online: C(a)HeK