Problems with adding custom sounds [Solved]

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

thelegend
Sith
Sith
Posts: 1433
Joined: Thu Jan 23, 2014 6:01 am
Projects :: Star Wars - Battlefront III Legacy
Games I'm Playing :: Swbf GTA CoD LoL KH
xbox live or psn: El_Fabricio#
Location: Right behind you :)

Problems with adding custom sounds [Solved]

Post by thelegend »

Hey all,
I keep my problem short but detailed:
I have followed Rend´s tutorial in adding sounds and the other one of adding custom sounds. But If I munge I always get this error:soundflmunge.exe :
Hidden/Spoiler:
Error : Unable to open file D:\BF2_ModTools\data_LC1\Sound\shell\effects\whooshl3.wav - while munging D:\BF2_ModTools\data_LC1\Sound\shell\shell.sfx
soundflmunge.exe : Error : Unable to open file D:\BF2_ModTools\data_LC1\Sound\shell\effects\whooshl3.wav, format may be invalid - while munging D:\BF2_ModTools\data_LC1\Sound\shell\shell.sfx
soundflmunge.exe : Error : Unable to read file list D:\BF2_ModTools\data_LC1\Sound\shell\shell.sfx - while munging D:\BF2_ModTools\data_LC1\Sound\shell\shell.sfx
I just munge with sound and sound only checked. But I think this error is not really important.
If I go to my _LVL_PC folder my sound.lvl is just 3kb file size.

Here are my sound files:
lc1.asfx:
Hidden/Spoiler:
effects\ak47.wav -resample xbox 22050 pc 22050
lc1.req:
Hidden/Spoiler:
ucft
{
REQN
{
"str"
"align=2048"


}
REQN
{
"lvl"
"lc1cw"

}
}
my lc1.sfx:
Hidden/Spoiler:
effects\ak47.wav -resample xbox 22050 pc 22050
and my lc1cw.req:
Hidden/Spoiler:
ucft
{
REQN
{
"bnk"
"lc1.asfx"
"lc1"
"align=2048"
"lc1cw"
}

REQN
{
"config"
"weaponsounds"
"weaponsounds.snd"
"all_weap_inf_rifle"

}
}
and here my weaponsounds.snd:
Hidden/Spoiler:
SoundProperties()

{
Name("ak47");
Group("weapons");
Inherit("weapon_template");
SampleList()
{
Sample("ak47", 1.0);
}
}
Note: All files are in my sound/worlds/lc1 folder.
Last edited by thelegend on Thu Jul 31, 2014 2:02 pm, edited 1 time in total.
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: Problems with adding custom sounds

Post by Anakin »

Are these files all you have in your sound folder?? beacuse you wrote you added these files to you req
"lc1.asfx"
"lc1"
"align=2048"
"lc1cw"

if you only want to add the one sound and nothing else it need to be
"align=2048"
"lc1"

and for the config section:
"config"
"weaponsounds"


if you have problems with your sound munge bat try this: http://www.gametoast.com/viewtopic.php?f=64&t=30282


You wrote you munged with the Modtools VisualMunge.exe If so there is the next misstake. you need to run the bat manuel.

about the shell errors. you don't have the shell sound files in your sound folder but have this line
@call soundmungedir _BUILD\sound\shell\%MUNGE_DIR% sound\shell sound\shell\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound shell

in your soundmunge.bat file.

i hope this helped
thelegend
Sith
Sith
Posts: 1433
Joined: Thu Jan 23, 2014 6:01 am
Projects :: Star Wars - Battlefront III Legacy
Games I'm Playing :: Swbf GTA CoD LoL KH
xbox live or psn: El_Fabricio#
Location: Right behind you :)

Re: Problems with adding custom sounds

Post by thelegend »

ok I got one sound to work. But how or what are the steps to add more than one sound file?
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: Problems with adding custom sounds

Post by Anakin »

ASFXNAME.asfx:
Hidden/Spoiler:
effects\mySoundFile1.wav -resample xbox 22050 pc 22050
effects\mySoundFile2.wav -resample xbox 22050 pc 22050
effects\mySoundFile3.wav -resample xbox 22050 pc 22050
effects\mySoundFile4.wav -resample xbox 22050 pc 22050
LVLNAME.req:
Hidden/Spoiler:
ucft
{
REQN
{
"str"
"align=2048"
}

REQN
{
"lvl"
"SOUNDGROUPE1"
"SOUNDGROUPE2"
}
}

SOUNDGROUPE1.req:
Hidden/Spoiler:
ucft
{
REQN
{
"bnk"
"align=2048"
"ASFXNAME"
}

REQN
{
"config"
"SOUNDNAMES1"
"SOUNDNAMES2"
}
}
SOUNDNAMES1.snd:
Hidden/Spoiler:
SoundProperties()

{
Name("mySoundName1");
Group("weapons");
Inherit("weapon_template");
SampleList()
{
Sample("mySoundFile1", 1.0);
}

Name("mySoundName2");
Group("weapons");
Inherit("weapon_template");
SampleList()
{
Sample("mySoundFile2", 1.0);
}
SOUNDNAMES2.snd:
Hidden/Spoiler:
SoundProperties()

Name("mySoundName3");
Group("weapons");
Inherit("weapon_template");
SampleList()
{
Sample("mySoundFile3", 1.0);
}
}
SOUNDGROUPE2.req:
Hidden/Spoiler:
ucft
{
REQN
{
"bnk"
"align=2048"
"ASFXNAME"
}

REQN
{
"config"
"SOUNDNAMES3"
}
}
SOUNDNAMES3.snd:
Hidden/Spoiler:
SoundProperties()

{
Name("mySoundName4");
Group("weapons");
Inherit("weapon_template");
SampleList()
{
Sample("mySoundFile4", 1.0);
}
}

You load the lvls that way:
ReadDataFile(""dc:PATH\\TO\\LVLFILE\\LVLNAME.lvl", "SOUNDGROUPE1")
ReadDataFile(""dc:PATH\\TO\\LVLFILE\\LVLNAME.lvl", "SOUNDGROUPE2")

in your effects folder (sound directory) need to be the mySoundFile.wav files.
in the odf you call mySoundName1, mySoundName2, mySoundName3, mySoundName4.
If you use the names 1 to 3 you need to load in the lua the SOUNDGROUPE1. if you want to use the name 4 you need to call SOUNDGROUPE2 in the lua.
Th SOUNDNAMES are just to make it easyer for you to group the files. e.g. all vehicle sounds, all weapon sounds,... the SOUNDGROUPE's are than for example the eras lc1cw or lc1gcw.
thelegend
Sith
Sith
Posts: 1433
Joined: Thu Jan 23, 2014 6:01 am
Projects :: Star Wars - Battlefront III Legacy
Games I'm Playing :: Swbf GTA CoD LoL KH
xbox live or psn: El_Fabricio#
Location: Right behind you :)

Re: Problems with adding custom sounds

Post by thelegend »

Ah ok. And I load 2 sounds in one group? So a little bit like the "tree system"? Or can I load more than 2 sounds in one group?
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: Problems with adding custom sounds

Post by Anakin »

you can load as many as you like. But you can also load in the SOUNDNAMES.snd file more than one sound. I did this in this example in the SOUNDNAMES1.snd file
thelegend
Sith
Sith
Posts: 1433
Joined: Thu Jan 23, 2014 6:01 am
Projects :: Star Wars - Battlefront III Legacy
Games I'm Playing :: Swbf GTA CoD LoL KH
xbox live or psn: El_Fabricio#
Location: Right behind you :)

Re: Problems with adding custom sounds

Post by thelegend »

I did exactly (not 100% exactly but so as you said) what you said.
In my lc1.req:
Hidden/Spoiler:
ucft
{
REQN
{
"str"
"align=2048"


}
REQN
{
"lvl"
"lc1sounds"

}
}
I put the name of the group where I load my my snd anf asfx file:

lc1sounds.req:
Hidden/Spoiler:
ucft
{
REQN
{
"bnk"
"lici"
"align=2048"
"lc1cw"
}

REQN
{
"config"
"weaponsounds"


}
}
And in my .asfx file I put:

Code: Select all

effects\9mm_shot.wav   -resample xbox 22050 pc 22050
And in weaponsounds.snd:
Hidden/Spoiler:
SoundProperties()

{


Name("9mm_shot");
Group("weapons");
Inherit("weapon_template");
SampleList()
{
Sample("9mm_shot", 1.0);
}



}
And in my lua I added the readdatafile line for my sounds:

Code: Select all

 ReadDataFile("dc:sound\\lc1.lvl;lici")
After that I munged with the munge.bat in _BUILD/ Sound.
I have moved the lc1.req to my sound folder in my addon directory but in game there is no one sound.
What I did wrong?
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: Problems with adding custom sounds

Post by Anakin »

1. req files in the SWBF addon directory is always a bad idea. BF can only handel lvl files and things like that. So munged files. But i'm prety sure you mean you put your sound lvl file in the directory.

2. I marked parts in your code red (look in the hide tags). compare them carfully with my example (marked, too).

thelegend wrote:I did exactly (not 100% exactly but so as you said) what you said.
In my lc1.req:
Hidden/Spoiler:
ucft
{
REQN
{
"str"
"align=2048"


}
REQN
{
"lvl"
"lc1sounds"

}
}
I put the name of the group where I load my my snd anf asfx file:

lc1sounds.req:
Hidden/Spoiler:
ucft
{
REQN
{
"bnk"
"lici"
"align=2048"
"lc1cw"

}

REQN
{
"config"
"weaponsounds"


}
}
And in my .asfx file I put:

Code: Select all

effects\9mm_shot.wav   -resample xbox 22050 pc 22050
And in weaponsounds.snd:
Hidden/Spoiler:
SoundProperties()

{


Name("9mm_shot");
Group("weapons");
Inherit("weapon_template");
SampleList()
{
Sample("9mm_shot", 1.0);
}



}
And in my lua I added the readdatafile line for my sounds:

Code: Select all

 ReadDataFile("dc:sound\\lc1.lvl;lici")
[/color]

After that I munged with the munge.bat in _BUILD/ Sound.
I have moved the lc1.req to my sound folder in my addon directory but in game there is no one sound.
What I did wrong?

Anakin wrote:ASFXNAME.asfx:
Hidden/Spoiler:
effects\mySoundFile1.wav -resample xbox 22050 pc 22050
effects\mySoundFile2.wav -resample xbox 22050 pc 22050
effects\mySoundFile3.wav -resample xbox 22050 pc 22050
effects\mySoundFile4.wav -resample xbox 22050 pc 22050
LVLNAME.req:
Hidden/Spoiler:
ucft
{
REQN
{
"str"
"align=2048"
}

REQN
{
"lvl"
"SOUNDGROUPE1"
"SOUNDGROUPE2"
}
}

SOUNDGROUPE1.req:
Hidden/Spoiler:
ucft
{
REQN
{
"bnk"
"align=2048"
"ASFXNAME"

}

REQN
{
"config"
"SOUNDNAMES1"
"SOUNDNAMES2"
}
}
SOUNDNAMES1.snd:
Hidden/Spoiler:
SoundProperties()

{
Name("mySoundName1");
Group("weapons");
Inherit("weapon_template");
SampleList()
{
Sample("mySoundFile1", 1.0);
}

Name("mySoundName2");
Group("weapons");
Inherit("weapon_template");
SampleList()
{
Sample("mySoundFile2", 1.0);
}
SOUNDNAMES2.snd:
Hidden/Spoiler:
SoundProperties()

Name("mySoundName3");
Group("weapons");
Inherit("weapon_template");
SampleList()
{
Sample("mySoundFile3", 1.0);
}
}
SOUNDGROUPE2.req:
Hidden/Spoiler:
ucft
{
REQN
{
"bnk"
"align=2048"
"ASFXNAME"
}

REQN
{
"config"
"SOUNDNAMES3"
}
}
SOUNDNAMES3.snd:
Hidden/Spoiler:
SoundProperties()

{
Name("mySoundName4");
Group("weapons");
Inherit("weapon_template");
SampleList()
{
Sample("mySoundFile4", 1.0);
}
}

You load the lvls that way:
ReadDataFile(""dc:PATH\\TO\\LVLFILE\\LVLNAME.lvl", "SOUNDGROUPE1")
ReadDataFile(""dc:PATH\\TO\\LVLFILE\\LVLNAME.lvl", "SOUNDGROUPE2")

in your effects folder (sound directory) need to be the mySoundFile.wav files.
in the odf you call mySoundName1, mySoundName2, mySoundName3, mySoundName4.
If you use the names 1 to 3 you need to load in the lua the SOUNDGROUPE1. if you want to use the name 4 you need to call SOUNDGROUPE2 in the lua.
Th SOUNDNAMES are just to make it easyer for you to group the files. e.g. all vehicle sounds, all weapon sounds,... the SOUNDGROUPE's are than for example the eras lc1cw or lc1gcw.
thelegend
Sith
Sith
Posts: 1433
Joined: Thu Jan 23, 2014 6:01 am
Projects :: Star Wars - Battlefront III Legacy
Games I'm Playing :: Swbf GTA CoD LoL KH
xbox live or psn: El_Fabricio#
Location: Right behind you :)

Re: Problems with adding custom sounds

Post by thelegend »

Ok. One new sound works. But If I want to add more sounds (all in different soundgroups and snd files; as you said) I get this error:

Code: Select all

ERROR[levelpack lc1.req]:Expecting bracket, but none was found.
File : d:\bf2_modtools\data_lc1\_build\sound\worlds\lc1\munged\pc\lc1sounds.lvl.
req(1)...

ucft <--
ERROR[levelpack lc1.req]:Expecting bracket, but none was found.
File : d:\bf2_modtools\data_lc1\_build\sound\worlds\lc1\munged\pc\lc1sounds.lvl.
req(1)...

ucft <--

   2 Errors    0 Warnings
in my black box that munged other files.
And in my _LVL_PC there are a lc1.lvl (1kb) and a lc1.lvl.req file (also 1kb).

Edit: I have added them in the groups you have explained me but it still doesn`t work. I always get this error message.
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: Problems with adding custom sounds

Post by Anakin »

Mh it says something about brakets missing. This often happens if you have forgotten an braket, or a file is missing, the bat stopps munging and the next process find a file with the missing braket.

What soundfiles do you have?? (a list of all files you want to add)
thelegend
Sith
Sith
Posts: 1433
Joined: Thu Jan 23, 2014 6:01 am
Projects :: Star Wars - Battlefront III Legacy
Games I'm Playing :: Swbf GTA CoD LoL KH
xbox live or psn: El_Fabricio#
Location: Right behind you :)

Re: Problems with adding custom sounds

Post by thelegend »

I just want to add 5 weapons soudns and a few vehicle sounds.
I have got 5 in my effects folder (because of 5 customized weapons). The vehicles will be muged later.
I made two snd files:

weaponsounds.snd:
Hidden/Spoiler:
SoundProperties()

{
Name("uzi");
Group("weapons");
Inherit("weapon_template");
SampleList()
{
Sample("uzi", 1.0);
}
}
weaponsounds2.snd:
Hidden/Spoiler:
SoundProperties()

{
Name("9mm_shot");
Group("weapons");
Inherit("weapon_template");
SampleList()
{
Sample("9mm_shot", 1.0);
}
}
My soundgroup req files:

lc1sounds.req:
Hidden/Spoiler:
ucft
{
REQN
{
"bnk"
"align=2048"
"lc1"
}

REQN
{
"config"
"weaponsounds"
}
}
lc2sounds.req:
Hidden/Spoiler:
ucft
{
REQN
{
"bnk"
"align=2048"
"lc1"
}

REQN
{
"config"
"weaponsounds2"
}
}
And in my req file:
Hidden/Spoiler:
ucft
{
REQN
{
"str"
"align=2048"
}

REQN
{
"lvl"
"lc1sounds"
"lc2sounds"
}
}
In my asfx file I load the uzi.wav and the 9mm_shot.wav.
I really don't know where a missing bracket could be.
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: Problems with adding custom sounds

Post by Anakin »

I had an simular problem with an bad wav file. You may want take an other wav to test. You sayed the uzi sound worked? So take this and an other one but not the 9mm
thelegend
Sith
Sith
Posts: 1433
Joined: Thu Jan 23, 2014 6:01 am
Projects :: Star Wars - Battlefront III Legacy
Games I'm Playing :: Swbf GTA CoD LoL KH
xbox live or psn: El_Fabricio#
Location: Right behind you :)

Re: Problems with adding custom sounds

Post by thelegend »

The problem is more if I add more than one sound to my effects folder (and to my files) I got 2 error messages. And the soundlvl is just 1kb size.
I tried it two days ago and the 9mm shot sound worked but If I tried to add one more sound I got this problems. And if I clean the lvl and the munged stuff and munge again (with 2 sounds saved in my folders) I get this errors again.

Edit: Ah wait wait. I found an other way. I just create more .lvl files with my sounds. My lua reads them all and I create more sound levels. I tired it out with 2 .lvl files and it works.

Edit2: ok. It just works with 2 dc: sound lvl files. But I found out I always errors that say expending brackets were not found and my lc2.req and lc2sounds.req is not an binary ucft file. I just added a new sound line in my asfx file.
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: Problems with adding custom sounds

Post by Anakin »

can you upload your sound files for me?? So i can try if it works on my munge bats.
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Problems with adding custom sounds

Post by Marth8880 »

You don't need a new lvl file for each sound - it's bad practice to do so anyways. Just fit all of your sound properties inside one .snd file and all of the .wav files inside one .asfx file, and shove 'em all into one REQ. It's not *that* complicated. :p
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: Problems with adding custom sounds

Post by Anakin »

he send me the wav files and i could make an lvl file of them. I reuploaded my snd, req, asfx,... files, so he can see where his problem was.
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Problems with adding custom sounds

Post by Marth8880 »

While that's all great and dandy, he should *also* learn how to do it himself so there's more than just like three or four of us who actually know how to do this sort of thing.
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: Problems with adding custom sounds

Post by Anakin »

that's why i just munged the weapon sounds for him, gave him the source back, so he can make his vehicle sounds by himselfe ;)
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Problems with adding custom sounds

Post by Marth8880 »

Ah. Alright. Great. :)
thelegend
Sith
Sith
Posts: 1433
Joined: Thu Jan 23, 2014 6:01 am
Projects :: Star Wars - Battlefront III Legacy
Games I'm Playing :: Swbf GTA CoD LoL KH
xbox live or psn: El_Fabricio#
Location: Right behind you :)

Re: Problems with adding custom sounds

Post by thelegend »

Ok. Thanks all. I know how to add the sounds. I know what I have to do and which files I have to edit. My only problem is that if I munge the sounds I always get this errors:
Hidden/Spoiler:
ERROR[levelpack lc1.req]:Expecting bracket, but none was found.
File : d:\bf2_modtools\data_lc1\_build\sound\worlds\lc1\munged\pc\lc1sounds.lvl.
req(1)...

ucft <--
ERROR[levelpack lc1.req]:Expecting bracket, but none was found.
File : d:\bf2_modtools\data_lc1\_build\sound\worlds\lc1\munged\pc\lc1sounds.lvl.
req(1)...

ucft <--

2 Errors 0 Warnings
And I use the same source I got by anakin. If I add one more line to my asfx file I get this errors. But if there us just one line it works well.
Post Reply