Call of Duty 5: Custom Sound 2: Difference between revisions

From COD Modding & Mapping Wiki
Jump to navigation Jump to search
(Created page with "! WIP ! Sound encoding won't work if there are any spaces in the folder paths, special characters might also cause problems. As the default installation path of the game contai...")
 
No edit summary
Line 1: Line 1:
! WIP !
! WIP !


== Setup sound encode environment (once) ==


Sound encoding won't work if there are any spaces in the folder paths, special characters might also cause problems. As the default installation path of the game contains spaces and renaming the directories would potentially break the game, I suggest to set up a new folder structure for sound conversion.
Sound encoding won't work if there are any spaces in the folder paths, special characters might also cause problems. As the default installation path of the game contains spaces and renaming the directories would potentially break the game, I suggest to set up a new folder structure for sound conversion.


Create a folder on any drive and in subfolders you want, but with '''no spaces''' in path! For instance <code>D:\Games\ModSound\</code> (will be refered to as mod dir)
#Create a folder on any drive, in any subfolders you want, but with '''no spaces''' in path!<br>For instance <code style="color: green">D:\Games\ModSound\</code> (will be refered to as ''modsound dir'')<br>Bad: <span style="text-decoration: line-through;"><code style="color: red">D:\Games\sound path\</code></span>
#Create these 8 subfolders:<ul><li><code>ModSound\bin\</code></li><li><code>ModSound\raw\</code></li><li><code>ModSound\raw\soundaliases\</code></li><li><code>ModSound\sound_assets\</code></li><li><code>ModSound\sound_assets\raw\</code></li><li><code>ModSound\sound_assets\raw\sound\</code></li><li><code>ModSound\sound_assets\raw\sound\SFX\</code></li><li><code>ModSound\sound_assets\raw\sound\stream\</code></li></ul>
#Copy '''MODSound.exe''' from CoD modtools to your ModSound\bin\ folder (and keep explorer opened for later)
#Get Microsoft's [http://msdn.microsoft.com/en-us/directx/ DirectX SDK]: [http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=6812 Download SDK June 2010] (currently latest)
#Open the downloaded file (<code>DXSDK_Jun10.exe</code>) with 7-Zip, e.g. right-click in explorer on the file, 7-Zip > Open
#Navigate to '''DXSDK\Utilities\bin\x86\'''
#Select '''AdpcmEncode.exe''' and '''xWMAEncode.exe''', drag and drop them into your modsound's bin dir: <code>ModSound\bin\AdpcmEncode.exe</code>...
#Rename xWMAEncode.exe to '''WMAEncode.exe''' (leading "x" stripped off)
#Get the zip-package of the [http://sourceforge.net/projects/sox/files/sox/ latest SoX] tool (Sound-Exchange): [http://sourceforge.net/projects/sox/files/sox/14.4.0/sox-14.4.0-win32.zip/download Download SoX v14.4.0]
#Open it with 7-Zip or the like and extract the following files to your modsound folder's <code>bin\</code> directory:<ul><li>libgomp-1.dll</li><li>pthreadgc2.dll</li><li>sox.exe</li><li>zlib1.dll</li></ul>
#Done, your sound encoding environment is ready to go!


...


Get Microsoft's [http://msdn.microsoft.com/en-us/directx/ DirectX SDK]: [http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=6812 Download SDK June 2010] (currently latest)
== Convert sounds and soundaliases ==


Open the downloaded file (<code>DXSDK_Jun10.exe</code>) with 7-Zip, e.g. right-click in explorer on the file, 7-Zip > Open
#Copy your custom soundalias file(s) from <code>CoD5\raw\soundaliases\</code> to <code>ModSound\raw\soundaliases\</code><br>Soundalias CSV creation is not covered here, check other tutorials and stock CSVs (you may use [http://www.openoffice.org/ Open Office] to view them).<br>'''Note:''' Don't forget the column header line, which goes like <code>name,platform,file,sequence,vol_min</code>... or it won't work at all!
#Convert the sound files you wanna use to '''WAVE (Microsoft PCM 16-bit)''' using [http://audacity.sourceforge.net/download/ Audacity] if they aren't already wav (e.g. mp3 to wav).<br>You may also re-export wav files with fancy sample rates (other than 11025, 22050, 44100, 48000, 96000) or if you experience problems with sound conversion later on.
#Put them into subfolders of <code>ModSound\sound_assets\raw\sound\</code>, streamed audio goes into <code>stream\...</code> and sound fx into <code>SFX\...</code><br>Create missing subfolders, like stream\'''music\''' for streamed music tracks or e.g. SFX\'''weapon\MG\''' if it's going to become a MG sound.
#Sounds shouldn't be directly placed into <code>ModSound\sound_assets\raw\sound\</code>, they may not work!
#Go to <code>ModSound\</code> in explorer, select '''bin''' folder, hold '''Shift and right-click''' on it. Context menu opens, click '''Open Command Window here''' (also see [http://www.askvg.com/enable-open-command-window-here-option-in-context-menu-in-windows-vista/ here])<br>Alternatively, hit Windows key, type cmd and hit enter to open a command prompt. If it says C:\... but your ModSound folder is on D:\..., type <code>D:</code> (drive letter and colon) and hit return. Change to ModSound\bin\ folder with <code>cd the\path\ModSound\bin</code> (e.g. Games\ModSound\bin) and hit enter
#Type <code>modsound -pc -verbose -aliasfiles your_aliasfile_name</code><br>If the soundalias CSV is <code>ModSound\raw\soundaliases\mp_yourmap.csv</code>, ''your_alias_name'' would be <code>mp_yourmap</code><br>(Note: modsound is not the ModSound directory, but the executable modsound.exe)
#If you wanna force it to encode all sounds even if they been already converted, add <code>-clean</code>, e.g. <code>modsound -pc -clean -verbose ...</code>
#As soon as you hit return, encoding will start and some info will be displayed. Hang on, especially ADPCM encoding can last quite a bit!
#When it's finished, copy the encoded sound files from <code>ModSound\raw\sound\</code> to <code>CoD5\raw\sound\</code>
#Add the soundalias CSV to your zone file: <code>sound,mp_yourmap,,all_mp</code> (for SP: ''all_sp'' at the end)
#Add sound fx (from <code>SFX\</code> folder) as well.<br>Example for <code>raw\sound\<u>SFX\weapon\MG\shot</u>.wav</code><br><ul><li><code>sound,SFX/weapon/MG/shot</code></li></ul>
#Build fastfile with your zone file (either using Launcher or a batch script).
#Pack streamed audio as IWD (not covered here).<br>Example for <code>raw\<u>sound\stream\music\mytrack.wav</u></code><br><ul><li><code>mp_yourmap.iwd\sound\stream\music\mytrack.wav</code></li></ul>
#The soundaliases defined in your soundalias CSV should now be available. Note: You may have to place fastfiles / IWDs into <code>%localappdata%\Activision\CoDWaW\usermaps\mp_yourmap\</code>!


Navigate to '''DXSDK\Utilities\bin\x86\'''


Select '''AdpcmEncode.exe''' and '''xWMAEncode.exe''', drag and drop them into your mod dir.
== Trouble shooting ==
 
<ul><li>
<p style="border: 1px solid gray">ERROR: .../sound_assets/'''MODSound.hst : file not found'''</p>
You can ignore this error message, MODSound.hst will be automatically created.
</li><li>
If there are spaces or special characters in the folder paths to your ModSound directory, the following errors will occur:
<p style="border: 1px solid gray">
Converting D:\CoD5\'''path''' to '''space'''\sound_assets\raw\sound\SFX\test_raw.wav failed with<br>
error '''ERROR_FILE_NOT_FOUND''' (The system cannot find the file specified)
<br><br>
ERROR: '''Couldn't open input file.'''
</p>
Read the above guide how to setup the sound encode environment!
</li></ul>
 
 
--[[User:CoDEmanX|CoDEmanX]] 22:03, 25 April 2012 (IST)
 
[[Category:Call of Duty 5]]
[[Category:Sounds]]
[[Category:Modding]]

Revision as of 00:03, 26 April 2012

! WIP !

Setup sound encode environment (once)

Sound encoding won't work if there are any spaces in the folder paths, special characters might also cause problems. As the default installation path of the game contains spaces and renaming the directories would potentially break the game, I suggest to set up a new folder structure for sound conversion.

  1. Create a folder on any drive, in any subfolders you want, but with no spaces in path!
    For instance D:\Games\ModSound\ (will be refered to as modsound dir)
    Bad: D:\Games\sound path\
  2. Create these 8 subfolders:
    • ModSound\bin\
    • ModSound\raw\
    • ModSound\raw\soundaliases\
    • ModSound\sound_assets\
    • ModSound\sound_assets\raw\
    • ModSound\sound_assets\raw\sound\
    • ModSound\sound_assets\raw\sound\SFX\
    • ModSound\sound_assets\raw\sound\stream\
  3. Copy MODSound.exe from CoD modtools to your ModSound\bin\ folder (and keep explorer opened for later)
  4. Get Microsoft's DirectX SDK: Download SDK June 2010 (currently latest)
  5. Open the downloaded file (DXSDK_Jun10.exe) with 7-Zip, e.g. right-click in explorer on the file, 7-Zip > Open
  6. Navigate to DXSDK\Utilities\bin\x86\
  7. Select AdpcmEncode.exe and xWMAEncode.exe, drag and drop them into your modsound's bin dir: ModSound\bin\AdpcmEncode.exe...
  8. Rename xWMAEncode.exe to WMAEncode.exe (leading "x" stripped off)
  9. Get the zip-package of the latest SoX tool (Sound-Exchange): Download SoX v14.4.0
  10. Open it with 7-Zip or the like and extract the following files to your modsound folder's bin\ directory:
    • libgomp-1.dll
    • pthreadgc2.dll
    • sox.exe
    • zlib1.dll
  11. Done, your sound encoding environment is ready to go!


Convert sounds and soundaliases

  1. Copy your custom soundalias file(s) from CoD5\raw\soundaliases\ to ModSound\raw\soundaliases\
    Soundalias CSV creation is not covered here, check other tutorials and stock CSVs (you may use Open Office to view them).
    Note: Don't forget the column header line, which goes like name,platform,file,sequence,vol_min... or it won't work at all!
  2. Convert the sound files you wanna use to WAVE (Microsoft PCM 16-bit) using Audacity if they aren't already wav (e.g. mp3 to wav).
    You may also re-export wav files with fancy sample rates (other than 11025, 22050, 44100, 48000, 96000) or if you experience problems with sound conversion later on.
  3. Put them into subfolders of ModSound\sound_assets\raw\sound\, streamed audio goes into stream\... and sound fx into SFX\...
    Create missing subfolders, like stream\music\ for streamed music tracks or e.g. SFX\weapon\MG\ if it's going to become a MG sound.
  4. Sounds shouldn't be directly placed into ModSound\sound_assets\raw\sound\, they may not work!
  5. Go to ModSound\ in explorer, select bin folder, hold Shift and right-click on it. Context menu opens, click Open Command Window here (also see here)
    Alternatively, hit Windows key, type cmd and hit enter to open a command prompt. If it says C:\... but your ModSound folder is on D:\..., type D: (drive letter and colon) and hit return. Change to ModSound\bin\ folder with cd the\path\ModSound\bin (e.g. Games\ModSound\bin) and hit enter
  6. Type modsound -pc -verbose -aliasfiles your_aliasfile_name
    If the soundalias CSV is ModSound\raw\soundaliases\mp_yourmap.csv, your_alias_name would be mp_yourmap
    (Note: modsound is not the ModSound directory, but the executable modsound.exe)
  7. If you wanna force it to encode all sounds even if they been already converted, add -clean, e.g. modsound -pc -clean -verbose ...
  8. As soon as you hit return, encoding will start and some info will be displayed. Hang on, especially ADPCM encoding can last quite a bit!
  9. When it's finished, copy the encoded sound files from ModSound\raw\sound\ to CoD5\raw\sound\
  10. Add the soundalias CSV to your zone file: sound,mp_yourmap,,all_mp (for SP: all_sp at the end)
  11. Add sound fx (from SFX\ folder) as well.
    Example for raw\sound\SFX\weapon\MG\shot.wav
    • sound,SFX/weapon/MG/shot
  12. Build fastfile with your zone file (either using Launcher or a batch script).
  13. Pack streamed audio as IWD (not covered here).
    Example for raw\sound\stream\music\mytrack.wav
    • mp_yourmap.iwd\sound\stream\music\mytrack.wav
  14. The soundaliases defined in your soundalias CSV should now be available. Note: You may have to place fastfiles / IWDs into %localappdata%\Activision\CoDWaW\usermaps\mp_yourmap\!


Trouble shooting

  • ERROR: .../sound_assets/MODSound.hst : file not found

    You can ignore this error message, MODSound.hst will be automatically created.

  • If there are spaces or special characters in the folder paths to your ModSound directory, the following errors will occur:

    Converting D:\CoD5\path to space\sound_assets\raw\sound\SFX\test_raw.wav failed with
    error ERROR_FILE_NOT_FOUND (The system cannot find the file specified)

    ERROR: Couldn't open input file.

    Read the above guide how to setup the sound encode environment!


--CoDEmanX 22:03, 25 April 2012 (IST)