The Ultimate Sound Modding Tutorial [WIP]

Started by Phobos, December 19, 2012, 09:31:55 PM

Previous topic - Next topic
So, I have gotten this to partially munge on 64-bit, but I don't know if this is the same problem other 64-bit users have or not.

My lvl gets mostly munged and then... WHAM! 
Code (txt) Select

soundflmunge.exe : Error : At least 1 value(s) must be specified for switch -banklistinput  - while munging

This happens whenever the .stm file is munging. (the file that defines the streams).  The command prompt itself says that it cannot find the path specified.  So basically I have a sound.lvl without the streams.
Suggestions?  Comments?  Find a 32 bit OS to munge on?
I'm going to keep messing with this until it munges...

Also, I notice that nothing has the common.bnk file in it.  Is this necessary?
The BOBclan:  A Rich History


Quote from: Unit 33 on November 29, 2014, 03:44:44 AM
'Please, tell me more about the logistics of the design of laser swords being wielded by space wizards' - Some guy on the internet.

March 26, 2014, 03:35:25 PM #16 Last Edit: March 26, 2014, 04:21:29 PM by -RepublicCommando-
What I'm saying here isn't solid completely, but it's my best guess.

The full munge isn't really the problem I don't think, but I seriously doubt it's actually munging the sounds (maybe the sound reqs, but not the actual sound).

I think the only thing you're getting munged is the REQs (practically everything except the *.wav files are technically just reqs or references, and function the same as the *.req file, just referencing to something and labelling it, then munge takes that info and outputs an lvl to match), so even though they are munging, the sound isn't, and therefor making the lvl, but only with some reference labels and no actual sound data.
-- Hopefully that can put someone on the right track.. Or at least an idea of how to find the right track.

I think the bik file is just another form of the sound(i've heard folks have extracted all the sounds from it with ease, but it's distorted), I have doubt that the game actually reads it at all..

Again, most of what I'm saying is probably shaky info, I'm not exactly a sound expert :P

Shock... many links in the first page seems to not longer exist and the tutorial isn't fully completed yet, perhaps someone knows a more up to date version ? Adding music and modding sounds would be a crucial step into making my mod.
Also, check out my total conversion for BF1: Ferocious Battlefront
http://www.moddb.com/mods/ferocious-battlefront

RELEASE INCOMING

December 19, 2016, 03:30:49 PM #18 Last Edit: December 19, 2016, 03:38:07 PM by Phobos
Quote from: Incognito on December 17, 2016, 08:27:33 AM
Shock... many links in the first page seems to not longer exist and the tutorial isn't fully completed yet, perhaps someone knows a more up to date version ? Adding music and modding sounds would be a crucial step into making my mod.
I'm not sure what the current gametoast links are for those threads or if they still exist.

The ultimate tutorial will be updated later once I rebuild the sound lvl for TWD mod. For now I recommend using psych0fred's documentation along with ginev's guide http://www.swbfgamers.com/index.php?topic=9395.0

The sound builder included in toolbox v4 has a tutorial included for adding music streams http://www.swbfgamers.com/index.php?action=downloads;sa=view;down=525
[spoiler]
QuoteSWBF Sound.LVL Builder 1.2
Released October 5 2010
Created by Phobos Developer and Phazon Elite (Thanks to RLCT.Fang for bugtesting)

This builder is for adding background music to custom maps for SWBF1. It is set up to add 5 songs that randomly shuffle in your world, although it's possible to add more than one song to each WAV. The current version only works for GCW era, although if you are savvy enough you can edit the files yourself for different eras. The default map name is phobos because that is what I set it up for. It is ok to leave it this way because it will not affect your map, but feel free to edit all of the files (config and batch) if you want to. Note that when you switch factions it will go to a different song.

Make sure that you extract this folder directly into your C:\ folder, because the directory structure cannot have any spaces or it will not munge properly. Also,any map with the LUA configured as outlined in this readme will be compatible with your munged Phobos.lvl sound file.

Known Bugs: Sometimes only plays part of the first song then either restarts or skips.

1. You have to convert your Mp3 files to WAV (I use audacity) with exactly "48 khz sample rate" and "16 bit sample format".
2. Export the files as 01.wav, 02.wav, 03.wav, 04.wav, and 05.wav
3. Move the WAV files into the streams folder.

---Editing The LUA---
4. Add this:
ReadDataFile("dc:sound\\phobos.lvl;phobosgcw");
Above this:
ReadDataFile("sound\\tat.lvl;tat1gcw");

5. Replace your entire "OpenAudioStream" section with this:
OpenAudioStream("dc:sound\\Phobos.lvl", "phobosgcw_music");
OpenAudioStream("dc:sound\\Phobos.lvl", "Phobos");
--OpenAudioStream("sound\\tat.lvl","tatgcw_music");
--OpenAudioStream("sound\\tat.lvl","tat1");
--OpenAudioStream("sound\\tat.lvl","tat1");
--OpenAudioStream("sound\\gcw.lvl","gcw_vo");
OpenAudioStream("sound\\gcw.lvl","gcw_tac_vo");
--OpenAudioStream("sound\\tat.lvl","tat1_emt");

6. Add this:
SetAmbientMusic(ALL,1.0,"all_phobos_amb_start",0,1);
SetAmbientMusic(ALL,0.99,"all_phobos_amb_middle",1,1);
SetAmbientMusic(ALL,0.99,"all_phobos_amb_middl2",2,1);
SetAmbientMusic(ALL,0.99,"all_phobos_amb_middl3",3,1);
SetAmbientMusic(ALL,0.1,"all_phobos_amb_end",4,1);

SetAmbientMusic(IMP,1.0,"all_phobos_amb_start",0,1);
SetAmbientMusic(IMP,0.99,"all_phobos_amb_middle",1,1);
SetAmbientMusic(IMP,0.99,"all_phobos_amb_middl2",2,1);
SetAmbientMusic(IMP,0.99,"all_phobos_amb_middl3",3,1);
SetAmbientMusic(IMP,0.1,"all_phobos_amb_end",4,1);
Below this:
SetOutOfBoundsVoiceOver(2,"Allleaving");
SetOutOfBoundsVoiceOver(1,"Impleaving");

7. Delete the following section:
SetAmbientMusic(ALL,1.0,"all_tat_amb_start",0,1);
SetAmbientMusic(ALL,0.99,"all_tat_amb_middle",1,1);
SetAmbientMusic(ALL,0.1,"all_tat_amb_end",2,1);
SetAmbientMusic(IMP,1.0,"imp_tat_amb_start",0,1);
SetAmbientMusic(IMP,0.99,"imp_tat_amb_middle",1,1);
SetAmbientMusic(IMP,0.1,"imp_tat_amb_end",2,1);

---Now you're done with the LUA so save.---

8. Click munge for phobos.lvl in _lvl_pc.
9. Munge your map
10. Copy the phobos.lvl into your sound folder for custom map.
[/spoiler]

also you can examine sereja's map assets which usually include a custom sound builder.

Awesome, thanks a lot.  :cheers:
Also, check out my total conversion for BF1: Ferocious Battlefront
http://www.moddb.com/mods/ferocious-battlefront

RELEASE INCOMING

Any chance I could get some help building new shell music streams? So far, with help using the shell.lvl builder, I've managed to load a new music file but the issue here is that when I start the game I only get the first audio track defined in my

Either I'm doing something wrong with my scripting or the config file is not working.
In Progress:
--Star Wars: Battlefront - Anniversary Edition (formerly Star Wars: Battlefront - Legacy Edition)

On Hold:
--Star Wars Battlefront: Elite Squadron For SWBF1
--Endor: Imperial Base

Quote from: Gistech on December 29, 2016, 02:38:29 AM
Any chance I could get some help building new shell music streams? So far, with help using the shell.lvl builder, I've managed to load a new music file but the issue here is that when I start the game I only get the first audio track defined in my

Either I'm doing something wrong with my scripting or the config file is not working.
Did you rebuild the shell.lvl in the SHELL\ENG folder or in the SOUND folder? If you can post your audio configs I'll take a look at them.

I modified the batch file for 64-bit munging like this
@echo off
@set path=Ext; C:\BattlefrontMods\DataPhobos=%Path%
echo \_build_pc
echo \_lvl_pc
echo start munging
pause
@set path=%Root-Path%Path%submunge
munge.bat


I haven't replaced the stock game music, though for rebuilding the shell.MVS I had to use names of stock cutscenes to add to the new campaign because the game engine ignores custom named BIKs. Also the fly through videos are hard-coded to repeat so I'm using historical campaign names.
Quote
// Historical Campaigns
..\..\_SOURCE_PC\shell\movies\bes1h01.bik
..\..\_SOURCE_PC\shell\movies\bes2h01.bik
..\..\_SOURCE_PC\shell\movies\end1h02.bik
..\..\_SOURCE_PC\shell\movies\end1h03.bik
..\..\_SOURCE_PC\shell\movies\geo1h01.bik
..\..\_SOURCE_PC\shell\movies\hot1h02.bik
..\..\_SOURCE_PC\shell\movies\kam1h01.bik
..\..\_SOURCE_PC\shell\movies\kam1h02.bik
..\..\_SOURCE_PC\shell\movies\nab1h01.bik
..\..\_SOURCE_PC\shell\movies\nab2h01.bik
..\..\_SOURCE_PC\shell\movies\tat1h01.bik
..\..\_SOURCE_PC\shell\movies\tat2h01.bik
..\..\_SOURCE_PC\shell\movies\yav1h01.bik
..\..\_SOURCE_PC\shell\movies\yav2h01.bik
..\..\_SOURCE_PC\shell\movies\kas2h01.bik
}

//// The Walking Dead Shell.MVS Seasons 1-2
// transition times used by all movies
MovieProperties()
{
    Name("transition_template");
    FadeInTime(0.0);
    FadeOutTime(0.5);
}

// TWD00
MovieProperties()
{
    Name("bes1h01");
    Inherit("transition_template");
    Movie("shell");
    SegmentList()
    {
        Segment("bes1h01", 1.0, 0);
    }
}

// TWD01
MovieProperties()
{
    Name("bes2h01");
    Inherit("transition_template");
    Movie("shell");
    SegmentList()
    {
        Segment("bes2h01", 1.0, 0);
    }
}

// TWD02
MovieProperties()
{
    Name("end1h02");
    Inherit("transition_template");
    Movie("shell");
    SegmentList()
    {
        Segment("end1h02", 1.0, 0);
    }
}

// TWD03
MovieProperties()
{
    Name("end1h03");
    Inherit("transition_template");
    Movie("shell");
    SegmentList()
    {
        Segment("end1h03", 1.0, 0);
    }
}

// TWD04
MovieProperties()
{
    Name("geo1h01");
    Inherit("transition_template");
    Movie("shell");
    SegmentList()
    {
        Segment("geo1h01", 1.0, 0);
    }
}

// TWD05
MovieProperties()
{
    Name("hot1h02");
    Inherit("transition_template");
    Movie("shell");
    SegmentList()
    {
        Segment("hot1h02", 1.0, 0);
    }
}

// TWD06
MovieProperties()
{
    Name("kam1h01");
    Inherit("transition_template");
    Movie("shell");
    SegmentList()
    {
        Segment("kam1h01", 1.0, 0);
    }
}

// TWD07
MovieProperties()
{
    Name("kam1h02");
    Inherit("transition_template");
    Movie("shell");
    SegmentList()
    {
        Segment("kam1h02", 1.0, 0);
    }
}

January 16, 2017, 02:16:03 PM #22 Last Edit: January 16, 2017, 02:20:07 PM by Gistech
In the sound folder. According to the file lists I've seen, that is where I'm supposed to put my shell sound files.

Here's the config:

// main shell music
SoundStreamProperties()
{
    Name("shell_soundtrack");
    Pitch(1.0);
    PitchDev(0.0);
    Gain(1.0);
    GainDev(0.0);
    ReverbGain(0.0);
    Bus("shellmusic");
    Looping(0);
    Pan(0.0);
    Mode3D(0);
    CyclePlayback(1);
    Stream("shell_music");
    SegmentList()
    {
        Segment("menu_endcredits", 0.083);
        Segment("menu_ep1_duelofthefates", 0.083);
        Segment("menu_ep2_acrossthestars", 0.083);
        Segment("menu_ep3_battleoftheheroes", 0.083);
        Segment("menu_ep4_thewar", 0.083);
        Segment("menu_ep5_clash", 0.083);
        Segment("menu_ep5_imperialmarch", 0.083);
        Segment("menu_ep6_spacebattle", 0.083);
        Segment("menu_r1_hope", 0.083);
        Segment("menu_r1_imperialtheme", 0.083);
        Segment("menu_tfu_battletheme.wav", 0.083);
        Segment("menu_tfu_maintheme", 0.083);
        //Segment("fullScalePinkNoiseStereo", 0.167);
        //Segment("fullScale1KSinWave", 0.167);
    }
}

// galactic conquest music
SoundStreamProperties()
{
    Name("shell_galacticconquest");
    Pitch(1.0);
    PitchDev(0.0);
    Gain(1.0);
    GainDev(0.0);
    ReverbGain(0.0);
    Bus("shellmusic");
    Looping(0);
    Pan(0.0);
    Mode3D(0);
    CyclePlayback(1);
    Stream("shell_music");
    SegmentList()
    {
        Segment("menu_ep2_acrossthestars", 0.167);
    }
}

// historical briefing music
SoundStreamProperties()
{
    Name("shell_droidinvasion");
    Pitch(1.0);
    PitchDev(0.0);
    Gain(1.0);
    GainDev(0.0);
    ReverbGain(0.0);
    Bus("shellmusic");
    Looping(0);
    Pan(0.0);
    Mode3D(0);
    CyclePlayback(1);
    Stream("shell_music");
    SegmentList()
    {
        Segment("campaign_cis", 0.167);
    }
}

SoundStreamProperties()
{
    Name("shell_clonewars");
    Pitch(1.0);
    PitchDev(0.0);
    Gain(1.0);
    GainDev(0.0);
    ReverbGain(0.0);
    Bus("shellmusic");
    Looping(0);
    Pan(0.0);
    Mode3D(0);
    CyclePlayback(1);
    Stream("shell_music");
    SegmentList()
    {
        Segment("campaign_rep", 0.167);
    }
}

SoundStreamProperties()
{
    Name("shell_imperialmarch");
    Pitch(1.0);
    PitchDev(0.0);
    Gain(1.0);
    GainDev(0.0);
    ReverbGain(0.0);
    Bus("shellmusic");
    Looping(0);
    Pan(0.0);
    Mode3D(0);
    CyclePlayback(1);
    Stream("shell_music");
    SegmentList()
    {
        Segment("campaign_imp", 0.167);
    }
}

SoundStreamProperties()
{
    Name("shell_clash");
    Pitch(1.0);
    PitchDev(0.0);
    Gain(1.0);
    GainDev(0.0);
    ReverbGain(0.0);
    Bus("shellmusic");
    Looping(0);
    Pan(0.0);
    Mode3D(0);
    CyclePlayback(1);
    Stream("shell_music");
    SegmentList()
    {
        Segment("campaign_all", 0.167);
    }
}


// shell transition sound effects
SoundProperties()
{
    Name("shell_transition_template");
    Pitch(1.0);
    PitchDev(0.1);
    Gain(1.0);
    GainDev(0.0);
    ReverbGain(1.0);
    Bus("shellfx");
    Looping(0);
    Mode3D(0);
}


// 1
SoundProperties()
{
    Name("shell_transition1_left");
    Inherit("shell_transition_template");
    Pitch(0.99);
    Pan(-1.0);
    SampleList()
    {
        Sample("whoosh01l", 1.0);
    }
}

SoundProperties()
{
    Name("shell_transition1_right");
    Inherit("shell_transition_template");
    Pan(1.0);
    SampleList()
    {
        Sample("whoosh01r", 1.0);
    }
}

SoundLayered()
{
    Name("shell_transition1");
    Layer("shell_transition1_left",  "shell_transition1_left", 0.0, 0.5);
    Layer("shell_transition1_right", "shell_transition1_right", 0.0, 0.5);
}

// 2
SoundProperties()
{
    Name("shell_transition2_left");
    Inherit("shell_transition_template");
    Pitch(0.99);
    Pan(-1.0);
    SampleList()
    {
        Sample("whoosh02l", 1.0);
    }
}

SoundProperties()
{
    Name("shell_transition2_right");
    Inherit("shell_transition_template");
    Pan(1.0);
    SampleList()
    {
        Sample("whoosh02r", 1.0);
    }
}

SoundLayered()
{
    Name("shell_transition2");
    Layer("shell_transition2_left",  "shell_transition2_left", 0.0, 0.5);
    Layer("shell_transition2_right", "shell_transition2_right", 0.0, 0.5);
}


// 3
SoundProperties()
{
    Name("shell_transition3_left");
    Inherit("shell_transition_template");
    Pitch(0.99);
    Pan(-1.0);
    SampleList()
    {
        Sample("whoosh03l", 1.0);
    }
}

SoundProperties()
{
    Name("shell_transition3_right");
    Inherit("shell_transition_template");
    Pan(1.0);
    SampleList()
    {
        Sample("whoosh03r", 1.0);
    }
}

SoundLayered()
{
    Name("shell_transition3");
    Layer("shell_transition3_left",  "shell_transition3_left", 0.0, 0.5);
    Layer("shell_transition3_right", "shell_transition3_right", 0.0, 0.5);
}


// 4
SoundProperties()
{
    Name("shell_transition4_left");
    Inherit("shell_transition_template");
    Pitch(0.99);
    Pan(-1.0);
    SampleList()
    {
        Sample("whoosh04l", 1.0);
    }
}

SoundProperties()
{
    Name("shell_transition4_right");
    Inherit("shell_transition_template");
    Pan(1.0);
    SampleList()
    {
        Sample("whoosh04r", 1.0);
    }
}

SoundLayered()
{
    Name("shell_transition4");
    Layer("shell_transition4_left",  "shell_transition4_left", 0.0, 0.5);
    Layer("shell_transition4_right", "shell_transition4_right", 0.0, 0.5);
}


// 5
SoundProperties()
{
    Name("shell_transition5_left");
    Inherit("shell_transition_template");
    Pitch(0.99);
    Pan(-1.0);
    SampleList()
    {
        Sample("whoosh05l", 1.0);
    }
}

SoundProperties()
{
    Name("shell_transition5_right");
    Inherit("shell_transition_template");
    Pan(1.0);
    SampleList()
    {
        Sample("whoosh05r", 1.0);
    }
}

SoundLayered()
{
    Name("shell_transition5");
    Layer("shell_transition5_left",  "shell_transition5_left", 0.0, 0.5);
    Layer("shell_transition5_right", "shell_transition5_right", 0.0, 0.5);
}


// 6
SoundProperties()
{
    Name("shell_transition6_left");
    Inherit("shell_transition_template");
    Pitch(0.99);
    Pan(-1.0);
    SampleList()
    {
        Sample("whoosh06l", 1.0);
    }
}

SoundProperties()
{
    Name("shell_transition6_right");
    Inherit("shell_transition_template");
    Pan(1.0);
    SampleList()
    {
        Sample("whoosh06r", 1.0);
    }
}

SoundLayered()
{
    Name("shell_transition6");
    Layer("shell_transition6_left",  "shell_transition6_left", 0.0, 0.5);
    Layer("shell_transition6_right", "shell_transition6_right", 0.0, 0.5);
}


// 7
SoundProperties()
{
    Name("shell_transition7_left");
    Inherit("shell_transition_template");
    Pitch(0.99);
    Pan(-1.0);
    SampleList()
    {
        Sample("whoosh07l", 1.0);
    }
}

SoundProperties()
{
    Name("shell_transition7_right");
    Inherit("shell_transition_template");
    Pan(1.0);
    SampleList()
    {
        Sample("whoosh07r", 1.0);
    }
}

SoundLayered()
{
    Name("shell_transition7");
    Layer("shell_transition7_left",  "shell_transition7_left", 0.0, 0.5);
    Layer("shell_transition7_right", "shell_transition7_right", 0.0, 0.5);
}


// 8
SoundProperties()
{
    Name("shell_transition8_left");
    Inherit("shell_transition_template");
    Pitch(0.99);
    Pan(-1.0);
    SampleList()
    {
        Sample("whoosh08l", 1.0);
    }
}

SoundProperties()
{
    Name("shell_transition8_right");
    Inherit("shell_transition_template");
    Pan(1.0);
    SampleList()
    {
        Sample("whoosh08r", 1.0);
    }
}

SoundLayered()
{
    Name("shell_transition8");
    Layer("shell_transition8_left",  "shell_transition8_left", 0.0, 0.5);
    Layer("shell_transition8_right", "shell_transition8_right", 0.0, 0.5);
}


// 9
SoundProperties()
{
    Name("shell_transition9_left");
    Inherit("shell_transition_template");
    Pitch(0.99);
    Pan(-1.0);
    SampleList()
    {
        Sample("whoosh09l", 1.0);
    }
}

SoundProperties()
{
    Name("shell_transition9_right");
    Inherit("shell_transition_template");
    Pan(1.0);
    SampleList()
    {
        Sample("whoosh09r", 1.0);
    }
}

SoundLayered()
{
    Name("shell_transition9");
    Layer("shell_transition9_left",  "shell_transition9_left", 0.0, 0.5);
    Layer("shell_transition9_right", "shell_transition9_right", 0.0, 0.5);
}


// 10
SoundProperties()
{
    Name("shell_transition10_left");
    Inherit("shell_transition_template");
    Pitch(0.99);
    Pan(-1.0);
    SampleList()
    {
        Sample("whoosh10l", 1.0);
    }
}

SoundProperties()
{
    Name("shell_transition10_right");
    Inherit("shell_transition_template");
    Pan(1.0);
    SampleList()
    {
        Sample("whoosh10r", 1.0);
    }
}

SoundLayered()
{
    Name("shell_transition10");
    Layer("shell_transition10_left",  "shell_transition10_left", 0.0, 0.5);
    Layer("shell_transition10_right", "shell_transition10_right", 0.0, 0.5);
}



It DOES munge the sound, but it seems the config isn't being included for some reason. I know this because when I try to load my custom shell.lvl sound file alongside the stock one via the shell_interface LUA, the first track on my file list will play - and that's it. If I solely load the new shell.lvl, nothing will play at all, including sound effects.
In Progress:
--Star Wars: Battlefront - Anniversary Edition (formerly Star Wars: Battlefront - Legacy Edition)

On Hold:
--Star Wars Battlefront: Elite Squadron For SWBF1
--Endor: Imperial Base

I'm not sure how much support the game engine has for custom-named sound effects added to a rebuilt stock sound\shell.lvl.

Calling on multiple shells in the shell_interface LUA probably won't work as I tried something similar once with the ifs_yoda script loading custom voiceovers in a LVL outside of the sound\shell and the game just ignored the file even though it was set up properly. That's interesting it plays the first track though.

Also if you have references in the config to WAV files that don't exist in the builder, there will be a munge error. I'd have to see the other files in your builder including the REQ to offer more advice about it, but if all else fails you might want to try adding your custom WAV tracks using the names of stock tracks. So basically "replacing" the stock sounds, like how I had to with the shell.mvs for adding new cutscenes.

I have a feeling you can't use the SFX file. So I'm going to see if we can go in via the ASFX.
In Progress:
--Star Wars: Battlefront - Anniversary Edition (formerly Star Wars: Battlefront - Legacy Edition)

On Hold:
--Star Wars Battlefront: Elite Squadron For SWBF1
--Endor: Imperial Base

I got it working! And it works exactly as it should (with the exception of the game not playing the briefing music when there is a video preceeding it)
In Progress:
--Star Wars: Battlefront - Anniversary Edition (formerly Star Wars: Battlefront - Legacy Edition)

On Hold:
--Star Wars Battlefront: Elite Squadron For SWBF1
--Endor: Imperial Base

does the same insructions apply for BFII?
If you are good at something, never do it for attention.