Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials

Reply
 
Thread Tools Display Modes
  #1  
Old 30-12-2021, 12:22
Masquerade's Avatar
Masquerade Masquerade is offline
Registered User
 
Join Date: Jan 2020
Location: Monte d'Or
Posts: 1,167
Thanks: 284
Thanked 1,358 Times in 615 Posts
Masquerade is on a distinguished road
How to correctly process WWise Vorbis Audio | Guide + WemTool

How to correctly process WWise Vorbis Audio | Guide + WemTool

Good evening everybody,

I am sure we have all seen audio in *.wem format before. This is a very common type of audio in games and is made by WWise sound engine. The audio in the .WEM format can either be Vorbis (you may know this as *.OGG) or WAVE audio (*.WAV).

Wems that contain WAV audio can be already compressed by ProFrager's Media Streams Compressor just fine and is not the focus of this guide.

Instead, I would like to explain the best way to compress the Vorbis wems. For normal vorbis audio, we would use ProFrager's OGGRE compressor however ProFrager also made a separate version of OGGRE for WWise vorbis. In order to gain the benefits of this tool, you could follow these steps:
  1. Use WW2OGG on your wem file to convert the *.wem file to an *.ogg file.
  2. Compress this *.ogg file with the WWise OGGRE encoder.
  3. Decompress the compressed file with the WWise OGGRE decoder
  4. Patch the decompressed output to the original *.wem file using your patch engine of choice. I like to use HDiffZ since it makes the smallest patches, however XDelta will be sufficient here.

This is a very basic process. However, from reading the above steps - you wil be thinking - how on Earth am I meant to use OGGRE (WWise version) with FreeArc?

The answer is, we don't. Because Oggre WWise can only proccess one file at once and not many files. FreeArc would bundle all of your *.oggs together in $$arcdatafile$$.tmp. Because we cannot use FreeArc for this (it would crash because the decoded output of the compressed *.ogg file DOES NOT MATCH the input file to the encoder), we have to go down a different route. Attempting to individually compress each *.wem file in a game where there could be thousands of wems is a nonsense task, so instead I simplified it.

I would like to introduce WemTool - a wrapper for several tools which will parallel process all of your wem files.
Code:
 WemTool [For Vorbis WWise Audio]

 Available Options:

 -e : encode wems
 -d : decode wems

 Example Usage:

 WemTool.exe -e
 WemTool.exe -d
Please note that this is a very simple program and WemTool.exe contains the following tools:

- WW2OGG by hcs64
- MParallel by LoRd_MuldeR
- Oggre WWise by ProFrager
- HDiffZ by sisong

In order to use it, simply drop WemTool.exe into the root of the game folder that contains *.wem files and run it from command line with either encode or decode option. WemTool will compress all the *.wem files possible (it runs recursive) and then delete the successfully compressed wems, leaving a *.ww file and a *.DIFFZ file which then can be decoded by WemTool back into a *.wem. All CPU threads are used. If any *.wem files are left after WemTool has run, it means that they contain Wave audio and you should compress them with MSC instead.

To demonstrate on a sample of *.wem files from the game "Old World":


My apologies for the long read. I hope you understand what has just been explained, but this is certainly a lot more wordy than I would have desired.

Please note that I did little to no coding here, it's Bat2Exe + all aforementioned tools, so all credits here go to ProFrager, LoRd_MuldeR, hcs64 and sisong for their tools which all are used by this program.
Attached Files
File Type: 7z WemTool.7z (1.48 MB, 60 views)

Last edited by Masquerade; 16-11-2022 at 02:37.
Reply With Quote
The Following 20 Users Say Thank You to Masquerade For This Useful Post:
acal3000 (01-01-2022), allgravy (27-04-2023), BLACKFIRE69 (30-12-2021), Cesar82 (30-12-2021), elit (05-03-2023), ffmla (31-12-2021), Gehrman (31-12-2021), Grumpy (30-12-2021), Hexagon123 (30-12-2021), KaktoR (30-12-2021), kj911 (31-12-2021), L0v3craft (08-01-2022), oltjon (04-02-2022), rambohazard (31-12-2021), ramydarkness (19-03-2022), Razor12911 (01-01-2022), sathex (06-02-2022), ScOOt3r (30-12-2021), shazzla (07-11-2022), Wanterlude (14-01-2022)
Sponsored Links
  #2  
Old 01-01-2022, 01:18
L33THAK0R's Avatar
L33THAK0R L33THAK0R is offline
Registered User
 
Join Date: Feb 2021
Location: Saudi Arabia
Posts: 352
Thanks: 119
Thanked 59 Times in 38 Posts
L33THAK0R is on a distinguished road
Quite an interesting read, well done putting this all together in such a cohesive post!
Reply With Quote
  #3  
Old 15-01-2022, 14:53
Masquerade's Avatar
Masquerade Masquerade is offline
Registered User
 
Join Date: Jan 2020
Location: Monte d'Or
Posts: 1,167
Thanks: 284
Thanked 1,358 Times in 615 Posts
Masquerade is on a distinguished road
WemTool v2
  • Moved from MTP to MParallel - increased console output, but everything seems to be working just fine now. Test on a sample before your game.

Last edited by Masquerade; 15-01-2022 at 15:11.
Reply With Quote
The Following User Says Thank You to Masquerade For This Useful Post:
KaktoR (15-01-2022)
  #4  
Old 15-01-2022, 16:47
Snake288 Snake288 is offline
Registered User
 
Join Date: Nov 2018
Location: Paris
Posts: 206
Thanks: 92
Thanked 34 Times in 28 Posts
Snake288 is on a distinguished road
Post

hello, if I may, the voice of God *.wem would like to ask your support on how to reduce the size of wem files the sample video can be a very understandable training video.

Last edited by Snake288; 15-01-2022 at 17:21.
Reply With Quote
  #5  
Old 16-01-2022, 00:26
fabrieunko fabrieunko is offline
Registered User
 
Join Date: Sep 2021
Location: france
Posts: 170
Thanks: 272
Thanked 52 Times in 45 Posts
fabrieunko is on a distinguished road
Hello, thank you works well on Gow on the other hand how to use it with an installer? is there one that supports it or do you have to do a .bat? who would run the -d function after decompressing the .bin?
Reply With Quote
  #6  
Old 16-01-2022, 01:07
Masquerade's Avatar
Masquerade Masquerade is offline
Registered User
 
Join Date: Jan 2020
Location: Monte d'Or
Posts: 1,167
Thanks: 284
Thanked 1,358 Times in 615 Posts
Masquerade is on a distinguished road
Quote:
Originally Posted by fabrieunko View Post
Hello, thank you works well on Gow on the other hand how to use it with an installer? is there one that supports it or do you have to do a .bat? who would run the -d function after decompressing the .bin?
Put this after your archive extraction via ISDone:
Code:
Exec2(ExpandConstant('{app}\WemTool.exe'), '-d')
Reply With Quote
  #7  
Old 16-01-2022, 04:23
fabrieunko fabrieunko is offline
Registered User
 
Join Date: Sep 2021
Location: france
Posts: 170
Thanks: 272
Thanked 52 Times in 45 Posts
fabrieunko is on a distinguished road
Thank you, can you help me? I use

Windows Phone Installer (DSG)

I have identified the ISdone line which I think is the correct one and the line Exec2

Code:
function ISArcExtract(CurComponent: Cardinal; PctOfTotal: Double; InName, OutPath, ExtractedPath: AnsiString; DeleteInFile: Boolean; Password, CfgFile, WorkPath: AnsiString; ExtractPCF: Boolean): Boolean; external 'ISArcExtract@{tmp}\ISDone.dll stdcall delayload';
function IS7ZipExtract(CurComponent: Cardinal; PctOfTotal: Double; InName, OutPath: AnsiString; DeleteInFile: Boolean; Password: AnsiString): Boolean; external 'IS7zipExtract@{tmp}\ISDone.dll stdcall delayload';
function ISRarExtract(CurComponent: Cardinal; PctOfTotal: Double; InName, OutPath: AnsiString; DeleteInFile: Boolean; Password: AnsiString): Boolean; external 'ISRarExtract@{tmp}\ISDone.dll stdcall delayload';
function ISPrecompExtract(CurComponent: Cardinal; PctOfTotal: Double; InName, OutFile: AnsiString; DeleteInFile: Boolean): Boolean; external 'ISPrecompExtract@{tmp}\ISDone.dll stdcall delayload';
function ISSRepExtract(CurComponent: Cardinal; PctOfTotal: Double; InName, OutFile: AnsiString; DeleteInFile: Boolean): Boolean; external 'ISSrepExtract@{tmp}\ISDone.dll stdcall delayload';
function ISxDeltaExtract(CurComponent: Cardinal; PctOfTotal: Double; MinRAM, MaxRAM: Integer; InName, DiffFile, OutFile: AnsiString; DeleteInFile, DeleteDiffFile: Boolean): Boolean; external 'ISxDeltaExtract@{tmp}\ISDone.dll stdcall delayload';
function ISPackZIP(CurComponent: Cardinal; PctOfTotal: Double; InName, OutFile: AnsiString; ComprLvl: Integer; DeleteInFile: Boolean): Boolean; external 'ISPackZIP@{tmp}\ISDone.dll stdcall delayload';
function ShowChangeDiskWindow(Text, DefaultPath, SearchFile: AnsiString): Boolean; external 'ShowChangeDiskWindow@{tmp}\ISDone.dll stdcall delayload';

function Exec2 (FileName, Param: PAnsiChar;Show: Boolean): Boolean; external 'Exec2@{tmp}\ISDone.dll stdcall delayload';
should I replace the line (just above) with this one?

Code:
Exec2(ExpandConstant('{app}\WemTool.exe'), '-d')
Reply With Quote
  #8  
Old 16-01-2022, 04:41
:( Sad8669 :( Sad8669 is offline
Registered User
 
Join Date: Oct 2020
Location: -
Posts: 203
Thanks: 97
Thanked 187 Times in 101 Posts
:( Sad8669 is on a distinguished road
An alternative way is to execute a bat file through Inno Setup.

Code:
[Run]
Filename: "{app}\your bat.bat"; Parameters: "install"; Flags: runhidden
where the bat contains commands to run WemTool.exe.
Reply With Quote
The Following User Says Thank You to :( Sad8669 For This Useful Post:
Masquerade (16-01-2022)
  #9  
Old 16-01-2022, 04:43
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 4,412
Thanks: 1,078
Thanked 7,017 Times in 2,658 Posts
KaktoR is on a distinguished road
Quote:
Originally Posted by fabrieunko View Post
Thank you, can you help me? I use

Windows Phone Installer (DSG)

I have identified the ISdone line which I think is the correct one and the line Exec2

Code:
function ISArcExtract(CurComponent: Cardinal; PctOfTotal: Double; InName, OutPath, ExtractedPath: AnsiString; DeleteInFile: Boolean; Password, CfgFile, WorkPath: AnsiString; ExtractPCF: Boolean): Boolean; external 'ISArcExtract@{tmp}\ISDone.dll stdcall delayload';
function IS7ZipExtract(CurComponent: Cardinal; PctOfTotal: Double; InName, OutPath: AnsiString; DeleteInFile: Boolean; Password: AnsiString): Boolean; external 'IS7zipExtract@{tmp}\ISDone.dll stdcall delayload';
function ISRarExtract(CurComponent: Cardinal; PctOfTotal: Double; InName, OutPath: AnsiString; DeleteInFile: Boolean; Password: AnsiString): Boolean; external 'ISRarExtract@{tmp}\ISDone.dll stdcall delayload';
function ISPrecompExtract(CurComponent: Cardinal; PctOfTotal: Double; InName, OutFile: AnsiString; DeleteInFile: Boolean): Boolean; external 'ISPrecompExtract@{tmp}\ISDone.dll stdcall delayload';
function ISSRepExtract(CurComponent: Cardinal; PctOfTotal: Double; InName, OutFile: AnsiString; DeleteInFile: Boolean): Boolean; external 'ISSrepExtract@{tmp}\ISDone.dll stdcall delayload';
function ISxDeltaExtract(CurComponent: Cardinal; PctOfTotal: Double; MinRAM, MaxRAM: Integer; InName, DiffFile, OutFile: AnsiString; DeleteInFile, DeleteDiffFile: Boolean): Boolean; external 'ISxDeltaExtract@{tmp}\ISDone.dll stdcall delayload';
function ISPackZIP(CurComponent: Cardinal; PctOfTotal: Double; InName, OutFile: AnsiString; ComprLvl: Integer; DeleteInFile: Boolean): Boolean; external 'ISPackZIP@{tmp}\ISDone.dll stdcall delayload';
function ShowChangeDiskWindow(Text, DefaultPath, SearchFile: AnsiString): Boolean; external 'ShowChangeDiskWindow@{tmp}\ISDone.dll stdcall delayload';

function Exec2 (FileName, Param: PAnsiChar;Show: Boolean): Boolean; external 'Exec2@{tmp}\ISDone.dll stdcall delayload';
should I replace the line (just above) with this one?

Code:
Exec2(ExpandConstant('{app}\WemTool.exe'), '-d')
No!

Use it in "procedure CurStepChanged" CurStep = ssPostInstall

I don't know this script, but it should look something like this
Code:
procedure CurStepChanged
...
..
if (CurStep = ssPostInstall) then begin
...
Exec2(ExpandConstant('{app}\WemTool.exe'), '-d')
..
__________________
Haters gonna hate
Reply With Quote
The Following User Says Thank You to KaktoR For This Useful Post:
Masquerade (16-01-2022)
  #10  
Old 16-01-2022, 04:53
fabrieunko fabrieunko is offline
Registered User
 
Join Date: Sep 2021
Location: france
Posts: 170
Thanks: 272
Thanked 52 Times in 45 Posts
fabrieunko is on a distinguished road
Thanks Kaktor, do you think this is good?

Code:
procedure CurStepChanged(CurStep: TSetupStep);
var
  ResultCode: Integer;
begin
  if CurStep = ssInstall then
  begin
    CreateDir(ExpandConstant('{app}\Uninstall'));
    FileCopy(ExpandConstant('{tmp}\botva2.dll'),ExpandConstant('{app}\Uninstall\botva2.dll'),True);
    FileCopy(ExpandConstant('{tmp}\dark.png'),ExpandConstant('{app}\Uninstall\dark.png'),True);
    FileCopy(ExpandConstant('{tmp}\light.png'),ExpandConstant('{app}\Uninstall\light.png'),True);
    FileCopy(ExpandConstant('{tmp}\Setup1.jpg'),ExpandConstant('{app}\Uninstall\Setup1.jpg'),True);
    FileCopy(ExpandConstant('{tmp}\Symbol Font.ttf'),ExpandConstant('{app}\Uninstall\Symbol Font.ttf'),True);
    FileCopy(ExpandConstant('{tmp}\bahnschrift.ttf'),ExpandConstant('{app}\Uninstall\bahnschrift.ttf'),True);
    Unpack_Process(not RamLimitChk.IsChecked);
  end;
  if (CurStep = ssPostInstall) and ISDoneError then
  begin
    SetTaskBarProgressValue(100);
    SetTaskBarProgressState(TBPF_ERROR);
    Exec(ExpandConstant('{uninstallexe}'), '/VerySilent','', sw_Hide, ewWaitUntilTerminated, ResultCode);

  end;
  if (CurStep = ssPostInstall) and not ISDoneError then
  begin
    Exec2(ExpandConstant('{app}\WemTool.exe'), '-d')
  #ifdef Redist1

Last edited by fabrieunko; 16-01-2022 at 04:56.
Reply With Quote
  #11  
Old 16-01-2022, 05:16
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 4,412
Thanks: 1,078
Thanked 7,017 Times in 2,658 Posts
KaktoR is on a distinguished road
Should be fine
__________________
Haters gonna hate
Reply With Quote
The Following User Says Thank You to KaktoR For This Useful Post:
fabrieunko (16-01-2022)
  #12  
Old 16-01-2022, 05:22
fabrieunko fabrieunko is offline
Registered User
 
Join Date: Sep 2021
Location: france
Posts: 170
Thanks: 272
Thanked 52 Times in 45 Posts
fabrieunko is on a distinguished road
Thank you very much for your help, I appreciate helping beginners like me. I have a last question about the executable Wemtool.exe where should I put it? next to my installer.ISS?
Reply With Quote
  #13  
Old 16-01-2022, 05:34
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 4,412
Thanks: 1,078
Thanked 7,017 Times in 2,658 Posts
KaktoR is on a distinguished road
You can either include it into your installer ([Files] section, DestDir: "{app}") or directly include it into game folder before compression.
__________________
Haters gonna hate
Reply With Quote
The Following User Says Thank You to KaktoR For This Useful Post:
fabrieunko (16-01-2022)
  #14  
Old 16-01-2022, 06:18
Snake288 Snake288 is offline
Registered User
 
Join Date: Nov 2018
Location: Paris
Posts: 206
Thanks: 92
Thanked 34 Times in 28 Posts
Snake288 is on a distinguished road
WemTool help with usage
information about the way it is used as a video or image
The God of War (*.wem) How can I compress multiple files? and how to restore compressed files
Reply With Quote
  #15  
Old 16-01-2022, 06:30
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 4,412
Thanks: 1,078
Thanked 7,017 Times in 2,658 Posts
KaktoR is on a distinguished road
Quote:
Originally Posted by Snake288 View Post
WemTool help with usage
information about the way it is used as a video or image
The God of War (*.wem) How can I compress multiple files? and how to restore compressed files
Make backup of all *.wem files first.

Put WemTool.exe in GodofWar game folder
Create a batch file in same folder
Code:
"E:\Games\GodofWar\WemTool.exe" -e
Execute the batch file and wait for finish

Compress the game

After installing/unpacking with your installer, let the installer run WemTool.exe with -d parameter (explained a few posts above).

Finish
__________________
Haters gonna hate
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Anno 1701 won't load, just get a blue screen! Shadow22 General Gaming 5 28-08-2012 13:52
Nero PMA Update failure angelosbg CD/DVD Software & Utilities 9 24-09-2008 04:40
CPU jumps up to 100% now, not before dav6 Software 11 24-05-2008 04:33
S.T.A.L.K.E.R. Shadow of Chernobyle - Crashing Cpt.Canuck General Gaming 4 23-03-2007 13:01
The Godfather, Game -- Unusual Error dvdmations PC Games 4 05-05-2006 04:04



All times are GMT -7. The time now is 08:08.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright 2000-2020, FileForums @ https://fileforums.com