Page 1 of 1

Sound Munge.bat's don't munge correctly [Solved]

Posted: Thu Oct 08, 2015 6:24 am
by thelegend
I am not going to say it's the .bat's fault but I guess something is not working correctly.
My Sound Munge .bat's don't munge any .asfx or .stm files anymore. I looked through my sound files for about 20 times but can't seem to find the mistake. I replaced my .bat files with Marth's and Anakin's uploaded sound fix files but still without success. I watched a part of Marth's Sound Stream Tutorial to fully understand all it's functions but my .bats still don't munge those files (.stm and .asfx). By the way I also munge stock sounds (only flyers and some tanks) and .sfx files have been munged correctly. I really can't understand why this happens. Maybe it's because I moved from PC to LapTop (Don't ask me, I am not a PC expert. I only know which cables have to be plugged in or not).
I hope you know what might cause these problems and can help me.

And my levelpack.log (In folder: taw) says:
Hidden/Spoiler:
[code]Logging LevelPack
11:50:5610/08/15

=== taw.lvl ===
Missing file taw_gcw_music_stm.str
Reqd by taw.req
0 Errors 0 Warnings

[/code]
Here are all Sound Files I have+an uploaded Sound folder:


taw.req:
Hidden/Spoiler:
[code]ucft
{
REQN
{
"str"
"align=2048"
"taw_gcw_music_stm"

}
REQN
{
"lvl"
"taw_gcw"
}
}[/code]
taw_gcw.req:
Hidden/Spoiler:
[code]ucft
{
REQN
{
"bnk"
"align=2048"
"taw_gcw_asfx"
"taw_gcw_sfx"
}

REQN
{
"config"
"taw_gcw_music_mus"
"taw_gcw_music_config_snd"
"Jabbas_Gate"
"imp_fly_tiebomber"
"imp_fly_tie"
"imp_hover_speederbike"
"imp_walk_atst"
"all_fly_xwing"
"all_fly_awing"
"all_fly_ywing"
"all_hover_combatspeeder"
"imp_hover_fightertank"
}
}[/code]
taw_gcw_asfx.asfx:
Hidden/Spoiler:
[code]effects\Jabbas_Gate.wav -resample xbox 22050 pc 22050[/code]
taw_gcw_sfx.sfx (Only a short part):
Hidden/Spoiler:
[code]

// Combatspeeder -----------------------------------------------------------------------------------------------
#ifplatform xbox pc
..\..\gcw\effects\wpn_cmbtSpdr_blaster_fire.wav -resample xbox 22050 pc 44100
..\..\gcw\effects\wpn_cmbtSpdr_turret_fire.wav -resample xbox 22050 pc 44100
..\..\gcw\effects\eng_combatSpeeder_hi_lp.wav -resample xbox 22050 pc 22050
..\..\gcw\effects\eng_combatSpeeder_mid_lp.wav -resample xbox 22050 pc 22050
..\..\gcw\effects\eng_combatSpeeder_low_lp.wav -resample xbox 22050 pc 22050
#endifplatform xbox pc
#ifplatform ps2
..\..\gcw\effects\wp2_cmbtSpdr_blaster_fire.wav wpn_cmbtSpdr_blaster_fire -resample ps2 16000
..\..\gcw\effects\wp2_cmbtSpdr_turret_fire.wav wpn_cmbtSpdr_turret_fire -resample ps2 16000
..\..\gcw\effects\eP2_combatSpeeder_hi_lp.wav eng_combatSpeeder_hi_lp -resample ps2 22050
..\..\gcw\effects\eP2_combatSpeeder_mid_lp.wav eng_combatSpeeder_mid_lp -resample ps2 12000
..\..\gcw\effects\eP2_combatSpeeder_low_lp.wav eng_combatSpeeder_low_lp -resample ps2 3000
#endifplatform ps2
// --------------------------------------------------------------------------------------------------------------

// IFT-RFT -------------------------------------------------------------------------------------------------
#ifplatform xbox pc
..\..\cw\effects\wpn_gunship_laser_fire.wav -resample xbox 22050 pc 44100
..\..\cw\effects\wp2_gunship_laser_lp.wav wpn_gunship_laser_lp -resample xbox 22050 pc 44100
..\..\global\effects\wpn_IFT_blaster_fire.wav -resample xbox 22050 pc 44100
..\..\global\effects\wpn_IFT_missile_fire.wav -resample xbox 22050 pc 44100
//..\..\global\effects\wpn_IFT_trtBlaster_fire.wav -resample xbox 22050 pc 22050
..\..\global\effects\eng_interceptorTank_low_lp.wav -resample xbox 11025 pc 22050
..\..\global\effects\eng_interceptorTank_mid_lp.wav -resample xbox 11025 pc 22050
..\..\global\effects\eng_interceptorTank_hi_lp.wav -resample xbox 22050 pc 22050
#endifplatform xbox pc
#ifplatform ps2
..\..\cw\effects\wp2_gunship_laser_fire.wav wpn_gunship_laser_fire -resample ps2 16000
..\..\cw\effects\wp2_gunship_laser_lp.wav wpn_gunship_laser_lp -resample ps2 8000
..\..\global\effects\wp2_IFT_blaster_fire.wav wpn_IFT_blaster_fire -resample ps2 16000
..\..\global\effects\wp2_IFT_missile_fire.wav wpn_IFT_missile_fire -resample ps2 16000
//..\..\global\effects\wp2_IFT_trtBlaster_fire.wav wpn_IFT_trtBlaster_fire -resample ps2 16000
..\..\global\effects\eP2_interceptorTank_low_lp.wav eng_interceptorTank_low_lp -resample ps2 3000
..\..\global\effects\eP2_interceptorTank_mid_lp.wav eng_interceptorTank_mid_lp -resample ps2 6000
..\..\global\effects\eP2_interceptorTank_hi_lp.wav eng_interceptorTank_hi_lp -resample ps2 16000
#endifplatform ps2
// ---------------------------------------------------------------------------------------------------------------


[/code]
Jabbas_Gate.snd:
Hidden/Spoiler:
[code]SoundProperties()
{
Name("Jabbas_Gate");
Group("Props");
Inherit("weapon_template");
SampleList()
{
Sample("Jabbas_Gate", 1.0);
}
}[/code]
taw_gcw_music_mus.mus:
Hidden/Spoiler:
[code]
Music()
{
Name("Jabbas_Palace_Amb");
Priority(0.0);
FadeInTime(1.0);
FadeOutTime(1.0);
MinPlaybackTime(20.0);
MinInactiveTime(2.0);
SoundStream("Jabbas_Palace_Amb");
}[/code]
taw_gcw_music_stm.stm:
Hidden/Spoiler:
[code]streams\Jabbas_Palace_Amb.wav Jabbas_Palace_Amb[/code]
taw_gcw_music_config_snd.snd:
Hidden/Spoiler:
[code]
SoundStream()
{
Name("Jabbas_Palace_Amb");
Pitch(1.0);
PitchDev(0.0);
Gain(1.0);
GainDev(0.0);
ReverbGain(0.0);
Bus("ingamemusic");
Looping(0);
Pan(0.0);
Mode3D(0);
Stream("taw_gcw_music_stm"); //.stm file
SegmentList()
{
Segment("Jabbas_Palace_Amb", 1.0);
}
}[/code]

Here is a picture how the folder looks like:

Hidden/Spoiler:
Image


And here are all three edited Sound Munge Files:

Soundmunge.bat:
Hidden/Spoiler:
[code]@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

@rem Munge global, shell and side specific sound data
@rem Munge world specific sound data
@call soundmungedir _BUILD\sound\worlds\taw\%MUNGE_DIR% sound\worlds\taw sound\worlds\taw\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound taw

@rem EDIT THE TWO LINES BELOW TO POINT TO YOUR MOD BY REPLACING SND WITH YOUR WORLD ABBREVIATION

@Start _BUILD\PC_MungeLog.txt

@goto exit
:noplatform
@echo Platform must be specified as the first argument
:exit[/code]
Soundmungedir.bat:
Hidden/Spoiler:
[code]@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%
@for /R %%A in (*.stm) 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%[/code]
munge.bat:
Hidden/Spoiler:
[code]@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
REM @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)

@rem convert to lower case
set 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
@for /R %%A in (*.stm) 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
[/code]

And here you can download the entire Sound Folder (taw) if you want to test out the munging process for yourself:
http://www.mediafire.com/download/xhshh ... _Files.rar

I also made sure that Streams use two tracks, and effects only one track.

Re: Sound Munge.bat's don't munge correctly

Posted: Thu Oct 08, 2015 5:13 pm
by AceMastermind
I'm not an audio expert but I use the Fixed and improved munge files from Marvel4 and couldn't munge your Jabbas_Gate.wav until I resaved it from Audacity. I think your Jabbas_Palace_Amb.wav may need to be resaved with different settings as well.

Edit
Yeah i'm getting a 9.68 MB taw.lvl in the sound folder now and when I open it in MFAudio I can hear the music.

When I munged I had Common, Sound, Sound Only and Audio Streams ticked.

Re: Sound Munge.bat's don't munge correctly [Solved]

Posted: Thu Oct 08, 2015 5:58 pm
by thelegend
AceMastermind wrote:I'm not an audio expert but I use the Fixed and improved munge files from Marvel4 and couldn't munge your Jabbas_Gate.wav until I resaved it from Audacity. I think your Jabbas_Palace_Amb.wav may need to be resaved with different settings as well.

Edit
Yeah i'm getting a 9.68 MB taw.lvl in the sound folder now and when I open it in MFAudio I can hear the music.

When I munged I had Common, Sound, Sound Only and Audio Streams ticked.
Ahh yes. It was my bad. I have exported them in 32bit. I should have exported them to 16bit. This caused the munge skipping. My sound file is also about 9Mb's now. Thank you :D