Jump to content


Photo

.wavc?


  • Please log in to reply
5 replies to this topic

#1 cmorgan

cmorgan
  • Modder
  • 2301 posts

Posted 21 January 2010 - 09:47 AM

Encoded sounds as WAVC instead of OGG format to save install time and space


I'm not on the workroom list (and am fine not being so :D ) but if you folks have figured out the WAVC hassles that led the community to use {.wavc in .bif} > .wav > .ogg > {.wav in override}, it would be way cool for someone to toss up the methodology!

I would so much prefer to have mods avoid the whole "separate audio decompression for Win, Lin, and OSX" shell script stuff, the set of .oggs to decompress, etc. for a simple

COPY ~mymod/audio/WAVC/c-aran01.wav~ ~override~
 	~mymod/audio/WAVC/c-aran02.wav~ ~override~
 	~mymod/audio/WAVC/c-aran03.wav~ ~override~
 	~mymod/audio/WAVC/c-aran04.wav~ ~override~
or even just a folder dump (though I would always line out every sound, just because I am paranoid)
COPY ~mymod/audio/WAVC~ ~overrride~
I know that early on there were claims of issues with .wavc format ambients clobbering/clogging stuff on Tutu/Easytutu as part of the Beregost problem, but I have also seen folks (older versions of Amber's Linux version) compress the sounds to .wavc format in the override.

Do we have any info?

#2 berelinde

berelinde

    Troublemaker

  • Modder
  • 4916 posts

Posted 21 January 2010 - 04:05 PM

I think the newer version of DLTCEP can handle the WAV to WAVC conversion, but beyond that, I don't know.

"Imagination is given to man to console him for what he is not; a sense of humor, for what he is." - Oscar Wilde

berelinde's mods
TolkienAcrossTheWater website
TolkienAcrossTheWater Forum


#3 Sam.

Sam.
  • Administrator
  • 1294 posts

Posted 21 January 2010 - 08:53 PM

PS gui also makes the conversion (probably a better conversion than DLTCEP). DLTCEP as well as the IESDP have it wrong in that they treat the WAVC header starting at offset 0x0010 as a constant value. DLTCEP always makes it stereo, 16-bit, 22050Hz, and an unknown value of 0x9ffd. The IESDP says it is always mono, 16-bit, 22050Hz, and an unknown value of 0xe777. In reality, some of the WAVC files in the game are mono and some are stereo. Most are 22050Hz but can at least also be 44100Hz. All of the files in my game do seem to be 16-bit, but they can probably also be 8-bit. The "unknown values" found in my game are 0x0000 (888 times), 0x9c77 (1878 times), 0xe777 (5967 times), 0xed77 (16 times), 0xfd7f (717 times), and 0xfd9f (168 times). PS gui writes 0xfd9f but it should probably write 0xe777 since it is the most common until I can figure out where the value actually comes from. They seem to play fine in-game regardless of the value, though. PS gui reads the information (number of channels, bits per sample, sampling rate) from the WAV file and writes that to the WAVC header and ACM header in the WAVC file so that the headers don't lie about the actual contents of the file.

Edit: I just did a test with 8-bit mono and 8-bit stereo input files and the game crashed when I tired to play them with the CLUA console regardless of whether the headers said they were 8 or 16 bit. Both 16-bit mono and 16-bit stereo WAVC files played fine from the override folder, though. Again, this is just one test. On a side note, all 4 combination played in NearInfinity....

Edit2: I also just tested WAVC files ranging from 8000Hz to 65535Hz and they all played correctly in-game from the override folder. Only 22050Hz files play properly in NearInfinity, though.

Edited by Sam., 21 January 2010 - 10:05 PM.

"Ok, I've just about had my FILL of riddle asking, quest assigning, insult throwing, pun hurling, hostage taking, iron mongering, smart-arsed fools, freaks, and felons that continually test my will, mettle, strength, intelligence, and most of all, patience! If you've got a straight answer ANYWHERE in that bent little head of yours, I want to hear it pretty damn quick or I'm going to take a large blunt object roughly the size of Elminster AND his hat, and stuff it lengthwise into a crevice of your being so seldom seen that even the denizens of the nine hells themselves wouldn't touch it with a twenty-foot rusty halberd! Have I MADE myself perfectly CLEAR?!"

--<CHARNAME> to Portalbendarwinden

--------------------

post-10485-0-15080600-1348188745.jpg
___________Old pen and paper modules of the 70s and 80s.___________

CA Forums CA Homepage


#4 Miloch

Miloch

    Barbarian

  • Modder
  • 6573 posts

Posted 22 January 2010 - 03:16 AM

COPY ~mymod/audio/WAVC~ ~overrride~

This is the bomb, and what Aurora uses (more or less, though we have separate platform-specific folders for BG2, Tutu, BGT etc.). You can get away with only 1 line of code, and you're probably more likely to miss something if you list files individually.

As for converting, it is as Sam says - just record your WAVs as 16-bit 22kHz and then mass-convert them to WAVCs with PS GUI. I listened to several I converted in NI and couldn't tell the difference, even after converting from OGGs rather than WAVs.

The size difference for 72 maximum-compressed RARed OGGs is 3.2MB vs. 5.4MB for the same WAVCs. But, the OGGs get decompressed to WAVs, which take up 13MB in the override! The WAVCs get copied as-is and still only take up 5.4MB.

I know that early on there were claims of issues with .wavc format ambients clobbering/clogging stuff on Tutu/Easytutu as part of the Beregost problem, but I have also seen folks (older versions of Amber's Linux version) compress the sounds to .wavc format in the override.

The ambient thing sounds like an urban legend. As far as Ascension64 could tell, the Beregost thing seems to be an inherent area or actor-related issue (though not any specific actor). As for ambients causing lag issues, it says that's possible even in the game readme, but I don't think the particular format matters. Actually WAVCs probably cause fewer issues than WAVs because they are smaller (the bigger the override, the more lag).

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#5 cmorgan

cmorgan
  • Modder
  • 2301 posts

Posted 22 January 2010 - 08:43 AM

Way cool (great work and research, Sam., very much appreciated) - and I am glad you guys worked out the wavc oddities enough to get them going. The "old days" definitely were more concerned with package size for download, rather than size on disk after install, but the two big plusses in my mind are as you said - 1. simple install/uninstall using weidu minus any shell scripts, and 2. wysiwyg (no reliance on encoding/decoding in the presence of whatever virus protection an end user is mistakenly running while installing.

As far as the ambient sound, what I can't tell is whether lag would increase or reduce with wavc - I see what you mean about size, Miloch, but .wav calls are just hooks. The engine does not have to process them. With wavc, doesn't the engine have to do the translation?

#6 cmorgan

cmorgan
  • Modder
  • 2301 posts

Posted 22 January 2010 - 08:52 AM

Just found your utility, Sam., and I am downloading it this weekend and giving it a shot. I read through the conversation, and realized Miloch already went through this with you, so sorry for the "late to the party" repeat. I have been trying to figure out a simpler way for dealing with mod-distributed audio, looking fpr a good way to make as close to a "one package fits all" solution, allowing a modder to support Windows, OSX, and Linux simply by lowercasing everything from the start and swapping out the weidu. This is a big step towards that.