Since Remastered, StarCraft supports ogg as well as wav. wav is uncompressed and large; ogg holds comparable quality in far less space - up to ten times less. With ogg supported there is no reason to ship wav.
What matters is not only using ogg but which quality. Audacity's ogg export takes a quality from 0 to 10, where 0 is about 64 kb/s and 10 about 500. The measured numbers make the choice obvious.
| Source mp3 | 4,524 KB |
|---|---|
| ogg quality 10 | 6,200 KB - larger than the source. |
| ogg quality 5 | 2,293 KB - roughly half. |
| ogg quality 0 | 870 KB, with little audible difference. |
Quality 10 is a trap: the file gets bigger than the source without sounding better, because re-encoding already-compressed audio at a higher bitrate cannot invent information that was never there.
Before embedding anything, check whether the sound is already in the game - then it costs nothing. PlayWAV takes an archive path, and StarCraft's own sound files are already in the archive: no MPQAddWave, no map size, no staredit\wav entry.
| sound\Misc\ | The UI sounds - Buzz.wav, the refusal buzz, and PError.wav. |
|---|---|
| sound\Bullet\ | Every weapon impact, e.g. LaserB.wav. |
| sound\Terran\<unit>\ | Unit voices, e.g. marine\TMaRdy00.wav. |
| sound\<race>\Advisor\ | “You require more minerals” and friends: PAdErr00.wav, ZAdErr00.wav, TAdErr00.wav. |
| sound\scr\misc\ | Remastered's own additions, such as scr_rankedup.wav. |
Lookup is case-insensitive: sound/Misc/Buzz.wav and sound/misc/Buzz.wav both resolve.
There are 1,331 stock sound paths in the game, and 1,082 of them do not need looking up - they are computed. The names follow one eight-character rule.
sound/<종족>/<폴더>/<r><uu><ttt><nn>.wav
// r : p 프로토스 / t 테란 / z 저그 / u 영웅
// uu : 유닛 두 글자 (ad 안내음, ma 마린, ze 질럿·저글링)
// ttt : 소리 종류 (아래 표)
// nn : 00, 01 ... 같은 대사의 여러 테이크
PlayWAV("sound/terran/marine/tmardy00.wav"); // "Commander?"
PlayWAV("sound/protoss/advisor/paderr00.wav"); // 미네랄이 부족합니다| wht | 255. Selected - "What?" |
|---|---|
| pss | 239. Annoyed, from selecting over and over |
| yes | 211. Acknowledging an order |
| upd | 102. Advisor update - "Research complete" |
| err | 87. Advisor error - "You require more minerals" |
| dth | 63. Death |
| rdy | 40. Finished production |
| att hit fir lau | Weapon fire and impact |
| The rest | One apiece per ability - yam Yamato, clo cloak, irr Irradiate, swm Swarm, emp EMP |
The folders use the engine's names, not the units'. Wraith is phoenix, Valkyrie is frigate, Reaver is trilobyte, Observer is witness, Scourge is avenger, Infested Terran is bugguy, Mutalisk is mutalid. Heroes start with u instead of a race letter - Zeratul is uzedth00.wav. The bldg folder is the one exception: there the two letters are per building.
All five announcers are in the install. What differs is the filenames - Jaekyung has GG_1 to GG_3, Jungmin and Yongjun a bare GG, Jini no GG line at all. The 31 advisor lines are the common part, and those are named identically for all five.
So do not probe one path and conclude a whole folder is missing. An earlier version of this lesson saw Jini\GG_1.wav fail and recorded the Jini announcer as absent; in fact Jini simply has no GG line and everything else was there. Resolving all 1,331 paths found 0 missing.
staredit\wav\ is not a game folder - it is where a map's own embedded sounds live. Copy a PlayWAV("staredit/wav/something.wav") line out of someone else's code and you get silence, because you do not have the file.
In any map with background music, the music is nearly all of the file. Past about 40 MB downloads drop off, and since every player must have the whole file before the game starts, people leave the lobby. Converting stereo to mono alone halves it, and for StarCraft background music the difference is hard to hear.
If you use freely published music, check the attribution terms. Most require credit, and a line in the map description or the forum post is usually enough.
Sound is per machine. PlayWAV only plays on that computer, which is why it is in the safe group in the desync lesson - firing it from a local condition is fine.
The trap is in the other direction: run "silence player 1's sound" from a shared condition and everyone's sound goes. Anything that stops a sound has to be wrapped in a condition that asks who is sitting at this machine.
There is no supported way to stop a sound that is already playing. A technique for doing it by writing memory circulates, but it uses a pointer that changes from run to run rather than a fixed address, and it predates Remastered. If background music has to stop on a condition, cut it into short pieces and play the next piece only while the condition holds.
You do not have to build that piece-by-piece playback yourself. euddraft ships a soundlooper library that reads each piece's real length out of the Ogg header - which matters because a cut piece is tens of milliseconds away from the length you asked for, so hand-timing drifts. And if one clip just needs to repeat, the bgmplayer plugin does it in two lines.
