Page 1 of 1

Custom sound effects won't work... [Solved]

Posted: Mon Jun 24, 2013 9:36 am
by Locutus
Heyho, I hope you can help me out a bit.
For the first time I started working on custom sounds but not everything works as it should. I followed the tutorial on how to add custom ambiance music which took me 10 minutes to work. Then I wanted to add some effects, followed the tutorial but ...nothing. I don't get any munge errors and my lvl file under _LVL_PC\sounds increased in file size but I can't hear the effects ingame. I have absolutely no idea what could be wrong; I spent hours on this.
Some of you are quite experienced in terms of adding sound, maybe you can find something. I have marked stuff in different colors to point out what refers to what.

SG1g_cmn.lua:
Hidden/Spoiler:
[...]
ReadDataFile("dc:sound\\SG1.lvl;SG1gcw)--works

ReadDataFile("sound\\spa.lvl;spa1gcw")
[...]


OpenAudioStream("dc:sound\\SG1.lvl", "SG1gcw_music")

OpenAudioStream("dc:sound\\SG1.lvl", "SG1gcw_effects")
OpenAudioStream("dc:sound\\SG1.lvl", "SG1gcw_effects")

SetAmbientMusic(ALL, 1.0, "tauri_ambient_music", 0,1);--works
SetAmbientMusic(IMP, 1.0, "wraith_ambient_music", 0,1);--works

SetVictoryMusic(ALL, "tau_wrt_victory")
SetDefeatMusic (ALL, "tau_wrt_defeat")
SetVictoryMusic(IMP, "tau_wrt_victory")
SetDefeatMusic (IMP, "tau_wrt_defeat")
[...]
SG1.req
Hidden/Spoiler:
ucft
{
REQN
{
"str"
"align=2048"
"SG1gcw_music"
}
REQN
{
"lvl"
"SG1gcw"
}

}
SG1gcw.req:
Hidden/Spoiler:
ucft
{
REQN
{
"bnk"
"align=2048"
"SG1gcw_effects"
}

REQN
{
"config"
"SG1gcw_music_config"
"SG1gcw_music"
"SG1gcw_effects_config"
}
}
SG1gcw_effects.asfx:
Hidden/Spoiler:
effects\Wraith_Medium_Plasma.wav -resample xbox 22050 pc 22050
SG1gcw_effects_config.snd:
Hidden/Spoiler:
// ----- effects template (copied from mass effect mod) ----------
SoundProperties()
{
Name("sg1_weapon_template"); // sound name to be called from
Group("weapons"); // sound group
Bus("soundfx"); // audio send bus
Pitch(1.0); // pitch of sound (0.0 to 1.0)
PitchDev(0.08); // variance of pitch (e.g., if Pitch were set to "0.5" and PitchDev to "0.1", sound would play anywhere at pitch of 0.4 to 0.6)
Gain(1.0); // amplification, or volume of sound (0.0 to 1.0)
GainDev(0.1); // variance of gain, see PitchDev
ReverbGain(0.0); //
Pan(0.0); // pan (transition) of sound (-1.0 to 1.0) (e.g., if Pan were set to "0.0", sound would be played at 50% gain through right and left speakers; if Pan were set to "-0.5", sound would be played at 75% gain through left speaker, 25% through right speaker)
RollIn(0.0); //
RollInDistance(1.0); //
MinDistance(1.0); // minimum distance sound gain will begin its drop-off
MuteDistance(5000.0); // distance from source the sound will be muted
MaxDistance(5000.0); // maximum distance the sound may be heard from its original source
RollOff(0.0); // slope of drop-off point graph of sound
Mode3D(1); // whether or not sound is three-dimensional (0 is disabled, 1 is enabled) (e.g., effects and voice overs are typically three-dimensional, meaning they are played through whichever speaker channels are closest to the sound's source relative to the player's position, whereas music and environmental streams are typically two-dimensional, meaning they are constantly played through the same channel(s))
ModeDoppler(0); // doppler effects toggle (0 is disabled, 1 is enabled)
Bias(0.0001); //
Priority(1.0); //
PlayProbability(1.0); // likelihood that the sound will play (0.0 to 1.0)
PlayInterval(0.0); // amount of time that must elapse before the sound may be played again
PlayIntervalDev(0.0); // variance of PlayInterval, see PitchDev
RandomPlayPos(0); //
CyclePlayback(0); // toggle whether or not sound should cycle through list of samples (0 is disabled, 1 is enabled)
SpaceDistance(8.0); //
}


// ----- effects ----------

SoundProperties()
{
Name("wraith_medium_plasma");
Group("weapons");
Inherit("sg1_weapon_template");
SampleList()
{
Sample("wraith_medium_plasma", 1.0);
}
}
wrt_fly_destroyer_cannon.odf:
Hidden/Spoiler:
[WeaponClass]
ClassLabel = "cannon"

[Properties]
OrdnanceName = "wrt_fly_destroyer_cannon_ord"

FireSound = "wraith_medium_plasma"
FireSoundStop = "0"

[...]

Edit: Solved.
Marth took a look (thanks, man!) and it turned out that my sound file was still too quiet-.-

Re: Custom sound effects won't work...

Posted: Mon Jun 24, 2013 10:49 am
by Marth8880
OpenAudioStream("dc:sound\\SG1.lvl", "SG1gcw_effects")
Get rid of both instances of that; OpenAudioStream is only for opening .stm and .st4 files. Also, make sure the capitalization and spelling is consistent in your sample (and stream) names across your bank and config files.

Have you normalized your sound in Audacity? Make sure it's at its maximum amplified gain.

Re: Custom sound effects won't work...

Posted: Mon Jun 24, 2013 11:32 am
by Locutus
Thanks for your quick reply.
As you suggested, I removed the lines from the script, fixed the capitalization in the asfx file, removed all pre-munged sound stuff and munged again. Still no luck ingame.
I'm not using audacity but I'm pretty sure the file is loud enough - definitely louder than my music stream file when i play it.

I get a 4,96kb lvl file if I only munge the sound without the streams even though the sound file itself is 19,2kb in size.

One thing I forgot to mention: My munge log says: "Der Befehl "soundflmunge" ist entweder falsch geschrieben oder konnte nicht gefunden werden." which means "The command "soundflmunge" is either spelled wrong or could not be found". Could that be an issue?
(It didn't seem to affect my stream munge, though).

Re: Custom sound effects won't work...

Posted: Mon Jun 24, 2013 3:20 pm
by Marth8880
You have the sound munge fix, correct?

Re: Custom sound effects won't work...

Posted: Mon Jun 24, 2013 3:31 pm
by Locutus
Yup.

soundmunge.bat:
Hidden/Spoiler:
@if %1x==x goto noplatform
@set MUNGE_PLATFORM=%1
@set MUNGE_DIR=MUNGED\%MUNGE_PLATFORM%
@rem EDIT THE LINE BELOW TO POINT TO YOUR BF2 INTSALL PATH
@set BF2_SOUNDPATH="c:\Program Files\LucasArts\Star Wars Battlefront II\"

@rem Munge global, shell and side specific sound data
@call soundmungedir _BUILD\sound\cw\%MUNGE_DIR% sound\cw sound\cw\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound cw
@call soundmungedir _BUILD\sound\gcw\%MUNGE_DIR% sound\gcw sound\gcw\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound gcw
@call soundmungedir _BUILD\sound\global\%MUNGE_DIR% sound\global sound\global\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound global nolevelfile
@call soundmungedir _BUILD\sound\shell\%MUNGE_DIR% sound\shell sound\shell\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound shell
@rem Munge world specific sound data
@call soundmungedir _BUILD\sound\worlds\cor\%MUNGE_DIR% sound\worlds\cor sound\worlds\cor\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound cor
@call soundmungedir _BUILD\sound\worlds\dag\%MUNGE_DIR% sound\worlds\dag sound\worlds\dag\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound dag
@call soundmungedir _BUILD\sound\worlds\dea\%MUNGE_DIR% sound\worlds\dea sound\worlds\dea\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound dea
@call soundmungedir _BUILD\sound\worlds\end\%MUNGE_DIR% sound\worlds\end sound\worlds\end\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound end
@call soundmungedir _BUILD\sound\worlds\fel\%MUNGE_DIR% sound\worlds\fel sound\worlds\fel\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound fel
@call soundmungedir _BUILD\sound\worlds\gal\%MUNGE_DIR% sound\worlds\gal sound\worlds\gal\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound gal
@call soundmungedir _BUILD\sound\worlds\geo\%MUNGE_DIR% sound\worlds\geo sound\worlds\geo\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound geo
@call soundmungedir _BUILD\sound\worlds\hot\%MUNGE_DIR% sound\worlds\hot sound\worlds\hot\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound hot
@call soundmungedir _BUILD\sound\worlds\kam\%MUNGE_DIR% sound\worlds\kam sound\worlds\kam\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound kam
@call soundmungedir _BUILD\sound\worlds\kas\%MUNGE_DIR% sound\worlds\kas sound\worlds\kas\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound kas
@call soundmungedir _BUILD\sound\worlds\mus\%MUNGE_DIR% sound\worlds\mus sound\worlds\mus\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound mus
@call soundmungedir _BUILD\sound\worlds\myg\%MUNGE_DIR% sound\worlds\myg sound\worlds\myg\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound myg
@call soundmungedir _BUILD\sound\worlds\nab\%MUNGE_DIR% sound\worlds\nab sound\worlds\nab\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound nab
@call soundmungedir _BUILD\sound\worlds\pol\%MUNGE_DIR% sound\worlds\pol sound\worlds\pol\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound pol
@call soundmungedir _BUILD\sound\worlds\spa\%MUNGE_DIR% sound\worlds\spa sound\worlds\spa\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound spa
@call soundmungedir _BUILD\sound\worlds\tan\%MUNGE_DIR% sound\worlds\tan sound\worlds\tan\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound tan
@call soundmungedir _BUILD\sound\worlds\tat\%MUNGE_DIR% sound\worlds\tat sound\worlds\tat\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound tat
@call soundmungedir _BUILD\sound\worlds\uta\%MUNGE_DIR% sound\worlds\uta sound\worlds\uta\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound uta
@call soundmungedir _BUILD\sound\worlds\yav\%MUNGE_DIR% sound\worlds\yav sound\worlds\yav\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound yav
@call soundmungedir _BUILD\sound\worlds\hero\%MUNGE_DIR% sound\worlds\hero sound\worlds\hero\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound hero
@call soundmungedir _BUILD\sound\worlds\SG1\%MUNGE_DIR% sound\worlds\SG1 sound\worlds\SG1\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound SG1

@rem EDIT THE TWO LINES BELOW TO POINT TO YOUR MOD BY REPLACING SND WITH YOUR WORLD ABBREVIATION
@call soundmungedir _BUILD\sound\worlds\snd\%MUNGE_DIR% sound\worlds\snd sound\worlds\snd\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound snd
xcopy _LVL_%MUNGE_PLATFORM%\sound\* %BF2_SOUNDPATH%GameData\addon\SND\data\_LVL_PC\Sound\ /Y

@goto exit
:noplatform
@echo Platform must be specified as the first argument
:exit
soundmungedir.bat:
Hidden/Spoiler:
@rem Save the starting directory
@for /F %%A in ('cd') do @set STARTDIR=%%A

@if %1x==x goto nomungedir
@if %2x==x goto nosourcedir
@if %3x==x goto nooverridedir
@if %4x==x goto noplatform
@if %5x==x goto nomungelogdir
@if %6x==x goto noleveldir
@if %7x==x goto nolevelsrcdir
@if %8x==x goto nolevelfile

@rem Setup directories
@set MUNGEDIR=%STARTDIR%\%1
@set SOURCEDIR=%STARTDIR%\%2
@set PLATFORMDIR=%STARTDIR%\%3
@set LOGDIR=%STARTDIR%\%5
@set LEVELDIR=%STARTDIR%\%6
@set LEVELFILEREQ=%8%.req
@set LEVELFILELVL=%MUNGEDIR%\%8%.lvl
@set CHECKDATE=-checkdate
@set CHECKID=-checkid
@if %SOUNDNODATECHECK%x==1x @set CHECKDATE=

@rem Build up a list of directories for level pack to search for source files
@Setlocal enabledelayedexpansion
@set LEVELSRCDIR=
@set PATH="%CD%"\..\ToolsFL\Bin;%PATH%

@rem Should we munge this level ?
@if /i not "%SOUNDLVL%"=="" (
@for %%A in (%SOUNDLVL%) do @if /i "%%A"=="%8" @goto mungeit
@goto exit
)
:mungeit

@if "%MUNGE_LOG%"=="" set MUNGE_LOG=%LOGDIR%\%4%_MungeLog.txt

@if not EXIST %SOURCEDIR% (
@echo Unable to munge %SOURCEDIR% as it doesn't exist! 1>> %MUNGE_LOG%
@goto exit
)

@REM goto nodebug
@echo Current Directory = %CD%
@echo Sound level filter = %SOUNDLVL%
@echo Munge output directory = %MUNGEDIR%
@echo Source directory = %SOURCEDIR%
@echo Platform override directory = %PLATFORMDIR%
@echo Selected platform = %4
@echo Munge logs directory = %LOGDIR%
@echo Level file output directory = %LEVELDIR%
@echo Final req file = %LEVELFILEREQ%
@echo Output level file = %LEVELFILELVL%
@echo Additional stream options = %STREAMOPT%
@REM pause
:nodebug

@if EXIST %MUNGEDIR% goto skipcreatemungedir
@mkdir %MUNGEDIR%
:skipcreatemungedir

@cd %SOURCEDIR%

@rem Munge configuration files
@rem *.snd - sound library
@rem *.mus - dynamic music configuration
@rem *.ffx - foley effects
@rem *.tsr - sound regions
@configmunge -inputfile *.snd *.mus *.ffx *.tsr -platform %4 -sourcedir %PLATFORMDIR% %SOURCEDIR% -outputdir %MUNGEDIR% -hashstrings %CHECKDATE% -continue 2>>%MUNGE_LOG%

@if %SOUNDLOG%x==1x ( @set SOUNDOPT=-verbose & @set SOUNDLOGOUT=%LOGDIR%\SoundBankLog.txt ) else ( @set SOUNDOPT= & @set SOUNDLOGOUT=NUL )

@rem Munge sound banks
@for /R %%A in (*.sfx) do @echo Munging %%~nA%%~xA & @soundflmunge -platform %4 -banklistinput %%A -bankoutput %MUNGEDIR%\ %CHECKDATE% -resample %CHECKID% noabort %SOUNDOPT% %BANKOPT% 2>>%MUNGE_LOG% 1>>%SOUNDLOGOUT%
@for /R %%A in (*.asfx) do @echo Munging %%~nA%%~xA & @soundflmunge -platform %4 -banklistinput %%A -bankoutput %MUNGEDIR%\ %CHECKDATE% -resample -checkid noabort %SOUNDOPT% 2>>%MUNGE_LOG% 1>>%SOUNDLOGOUT%

@rem Munge streams

@rem Localization
@rem Setup the extension of localized stream files (if it's english we'll just use the default extension)
@set LANGVERSION=
@rem @for /F %%A in (%MUNGE_LANGVERSION%) do @set LANGVERSION=%%~A
@set LANGVERSION=%MUNGE_LANGVERSION%
@if /i %LANGVERSION%x==Englishx ( @set LOCALIZEEXT= ) else ( @set LOCALIZEEXT=stm_%LANGVERSION% )

@rem make the directory for language-specific stuff if it doesn't exist - H8 h8 h8!
@if EXIST %MUNGEDIR%\%LANGVERSION% goto skipcreatelangdir
@echo Creating dir %MUNGEDIR%\%LANGVERSION%\
@mkdir %MUNGEDIR%\%LANGVERSION%
:skipcreatelangdir

@rem Munge localized stream files
@if /i not %MUNGESTREAMS%x==0x @if /i not %LANGVERSION%x==Englishx @for /R %%A in (*.%LOCALIZEEXT%) do @echo Munging %%~nA%%~xA to %MUNGEDIR%\%LANGVERSION%\ & soundflmunge -platform %4 -banklistinput %%A -bankoutput %MUNGEDIR%\%LANGVERSION%\%%~nA.str -stream %CHECKDATE% -resample %CHECKID% noabort %SOUNDOPT% %STREAMOPT% 2>>%MUNGE_LOG% 1>>%SOUNDLOGOUT%

@set MUNGE2SUBSTREAMS=0
@if /i %4==XBOX @set MUNGE2SUBSTREAMS=1
@if /i %4==PC @set MUNGE2SUBSTREAMS=1

@rem Build up a list of 1 substream streams to munge,
@rem Filtering the localize streams and if on xbox 4 channel streams
@set MUNGESUBSTREAM1=
@if /i not %MUNGESTREAMS%x==0x @for /R %%A in (*.stm) do @if /i %%~xA==.stm ( @if not EXIST %%~dA%%~pA%%~nA.%LOCALIZEEXT% ( @if /i %MUNGE2SUBSTREAMS%==1 ( @if not EXIST %%~dA%%~pA%%~nA.st4 @set MUNGESUBSTREAM1=!MUNGESUBSTREAM1! %%A ) else ( @set MUNGESUBSTREAM1=!MUNGESUBSTREAM1! %%A ) ) )

@rem Munge 1 substream streams
@if /i not %MUNGESTREAMS%x==0x @for %%A in (%MUNGESUBSTREAM1%) do @echo Munging %%~nA%%~xA & soundflmunge -platform %4 -banklistinput %%A -bankoutput %MUNGEDIR%\ -stream %CHECKDATE% -resample %CHECKID% noabort %SOUNDOPT% %STREAMOPT% 2>>%MUNGE_LOG% 1>>%SOUNDLOGOUT%

@rem Munge 2 substream streams
@if /i not %MUNGESTREAMS%x==0x @if %MUNGE2SUBSTREAMS%==1 @for /R %%A in (*.st4) do @echo Munging %%~nA%%~xA & soundflmunge -platform %4 -banklistinput %%A -bankoutput %MUNGEDIR%\ -stream %CHECKDATE% -resample %CHECKID% noabort %SOUNDOPT% %STREAMOPT% -substream 2 2>>%MUNGE_LOG% 1>>%SOUNDLOGOUT%

@rem Build level files
@if EXIST %LEVELDIR% goto skipcreateleveldir
@mkdir %LEVELDIR%
:skipcreateleveldir

@if %SOUNDNOLVL%x==1x @goto exit

@rem build up a list of include directories for levelpack
@rem language overrides first!
@if %LANGVERSION%x==x goto skiplang
@for /F %%A in ('dir /AD /B %STARTDIR%\%7') do @set LANGSRCDIR=!LANGSRCDIR! %STARTDIR%\%7\%%A\MUNGED\%4\%LANGVERSION%
@for /F %%A in ('dir /AD /B %STARTDIR%\%7\Worlds') do @set LANGSRCDIR=!LANGSRCDIR! %STARTDIR%\%7\Worlds\%%A\MUNGED\%4\%LANGVERSION%
:skiplang

@for /F %%A in ('dir /AD /B %STARTDIR%\%7') do @set LEVELSRCDIR=!LEVELSRCDIR! %STARTDIR%\%7\%%A\MUNGED\%4
@for /F %%A in ('dir /AD /B %STARTDIR%\%7\Worlds') do @set LEVELSRCDIR=!LEVELSRCDIR! %STARTDIR%\%7\Worlds\%%A\MUNGED\%4

@for /R %%A in (*.req) do @if /i not %%A==%SOURCEDIR%\%LEVELFILEREQ% levelpack -inputfile %%~nA%%~xA -platform %4 -sourcedir %SOURCEDIR% %LANGSRCDIR% %PLATFORMDIR% -inputdir %LEVELSRCDIR% -outputdir %MUNGEDIR% -continue %CHECKDATE%

@if EXIST %LEVELFILEREQ% levelpack -inputfile %LEVELFILEREQ% -platform %4 -sourcedir %SOURCEDIR% %LANGSRCDIR% %PLATFORMDIR% -inputdir %LEVELSRCDIR% -outputdir %LEVELDIR% -continue %CHECKDATE%

@goto exit

:nomungedir
@echo Munge directory must be specified as the first argument
@goto exit
:nosourcedir
@echo Source data directory must be specified as the second argument
@goto exit
:nooverridedir
@echo Platform specific source data directory must be specified as the third argument
@goto exit
:noplatform
@echo Platform must be specified as the fourth argument
@goto exit
:nomungelogdir
@echo Munge log directory must be specified as the fifth argument
@goto exit
:noleveldir
@echo Level output directory must be specified as the sixth argument
@goto exit
:nolevelsrcdir
@echo Level source direct must be specified as the seventh argument
@goto exit
:nolevelfile
@echo Final output level file must be specified as the eighth argument
@goto exit
:exit
@endlocal
@cd %STARTDIR%
...\_BUILD\Sound\munge.bat:
Hidden/Spoiler:
@REM WARNING: enabledelayedexpansion means ! is a special character,
@REM which means it isn't available for use as the mungeapp recursive
@REM wildcard character. Use the alternate $ instead.
@setlocal enabledelayedexpansion

@set MUNGE_ROOT_DIR=..\..
@if not "%1"=="" set MUNGE_PLATFORM=%1
@if %MUNGE_PLATFORM%x==x set MUNGE_PLATFORM=PC
@if "%MUNGE_BIN_DIR%"=="" (
@set MUNGE_BIN_DIR=%CD%\%MUNGE_ROOT_DIR%\..\ToolsFL\Bin
@set PATH=%CD%\..\..\..\ToolsFL\Bin;%PATH%
@echo MUNGE_BIN_DIR=!MUNGE_BIN_DIR!
)

@rem convert to lower case
@if %MUNGE_PLATFORM%==PC set MUNGE_PLATFORM=pc
@if %MUNGE_PLATFORM%==XBOX set MUNGE_PLATFORM=xbox
@if %MUNGE_PLATFORM%==PS2 set MUNGE_PLATFORM=ps2

@if /i %MUNGE_PLATFORM%==pc @set BANKOPT=-template -stub c:\windows\media\chord.wav
@set MUNGE_DIR=MUNGED\%MUNGE_PLATFORM%

@set LOCAL_MUNGE_LOG="%CD%\%MUNGE_PLATFORM%_MungeLog.txt"
@if "%MUNGE_LOG%"=="" (
@set MUNGE_LOG=%LOCAL_MUNGE_LOG%
@if exist %LOCAL_MUNGE_LOG% ( del %LOCAL_MUNGE_LOG% )
)
@rem echo ********************************************************************* >> %MUNGE_LOG%
@rem echo Sound\munge.bat %MUNGE_PLATFORM% >> %MUNGE_LOG%
@rem echo MUNGE_BIN_DIR=%MUNGE_BIN_DIR% >> %MUNGE_LOG%
@rem echo ********************************************************************* >> %MUNGE_LOG%

@cd ..\..

@if not exist _LVL_%MUNGE_PLATFORM% mkdir _LVL_%MUNGE_PLATFORM%
@if not exist _LVL_%MUNGE_PLATFORM%\Sound mkdir _LVL_%MUNGE_PLATFORM%\Sound


@call soundmunge.bat %MUNGE_PLATFORM%
@if %SOUNDCLEANLVL%x==1x @del /S /Q _BUILD\sound\*.lvl & @call soundmunge.bat %MUNGE_PLATFORM%

@if /i not "%SOUNDLVL%"=="" (
@for %%A in (%SOUNDLVL%) do @if /i "%%A"=="global" @goto buildglobalbank
@goto skipglobalbank
)
:buildglobalbank
@rem Build a global sound bank...
@set BANKLIST=
@for /R %%A in (*.sfx) do @set BANKLIST=!BANKLIST! %%A
@for /R %%A in (*.asfx) do @set BANKLIST=!BANKLIST! %%A
@if %SOUNDLOG%x==1x ( @set SOUNDOPT=-verbose & @set SOUNDLOGOUT=%LOGDIR%\SoundBankLog.txt ) else ( @set SOUNDOPT= & @set SOUNDLOGOUT=NUL )

@if not %MUNGE_PLATFORM%==pc goto skipglobalbank
@echo Munging common.bnk, this could take a while...
@soundflmunge -platform %MUNGE_PLATFORM% -banklistinput %BANKLIST% -bankoutput _LVL_%MUNGE_PLATFORM%\Sound\common.bnk -checkdate -resample -compact nowarning -checkid noabort -relativepath %SOUNDOPT% 2>>%MUNGE_LOG% 1>>%SOUNDLOGOUT%

:skipglobalbank

@cd _BUILD\Sound

@REM If the munge log was created locally and has anything in it, view it
@if not %MUNGE_LOG%x==%LOCAL_MUNGE_LOG%x goto skip_mungelog
@set FILE_CONTENTS_TEST=
@if exist %MUNGE_LOG% for /f %%i in (%MUNGE_LOG:"=%) do @set FILE_CONTENTS_TEST=%%i
@if not "%FILE_CONTENTS_TEST%"=="" ( Notepad.exe %MUNGE_LOG% ) else ( if exist %MUNGE_LOG% (del %MUNGE_LOG%) )

:skip_mungelog

@rem convert to upper case
@if %MUNGE_PLATFORM%==pc set MUNGE_PLATFORM=PC
@if %MUNGE_PLATFORM%==xbox set MUNGE_PLATFORM=XBOX
@if %MUNGE_PLATFORM%==ps2 set MUNGE_PLATFORM=PS2

@endlocal

Re: Custom sound effects won't work...

Posted: Mon Jun 24, 2013 4:23 pm
by AceMastermind
soundmunge.bat:
Hidden/Spoiler:
@if %1x==x goto noplatform
@set MUNGE_PLATFORM=%1
@set MUNGE_DIR=MUNGED\%MUNGE_PLATFORM%
@rem EDIT THE LINE BELOW TO POINT TO YOUR BF2 INTSALL PATH
@set BF2_SOUNDPATH="c:\Program Files\LucasArts\Star Wars Battlefront II\"
...
...
I just want to point out that if you use the Steam version of SWBF2 then you'll need to update the BF2_SOUNDPATH line since the path is different.

Re: Custom sound effects won't work...

Posted: Tue Jun 25, 2013 2:18 pm
by Locutus
Thanks for the info:)
I'm not using the steam version, though.

Would be awesome if someone was willing to try out my files. I bet I'm missing something stupid here:/ PM maybe?

Re: Custom sound effects won't work...

Posted: Tue Jun 25, 2013 3:22 pm
by Marth8880
Go ahead and shoot me one, sure.