Sound Research & Information (FAQ)

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

Post Reply
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:

Sound Research & Information (FAQ)

Post by Marth8880 »

Hi guys, I just thought I'd stick a bit of thrown-about, not-very-well-known, and also undocumented (at least Gametoast-undocumented) information and research about sounds in this thread. I will continue to update this thread as I learn more about the SWBF2 sound engine. I will use lots of information and configurations from Unification in this thread.


Addressed in this thread:
  • file hierarchy
  • audio specifications
  • buses
  • requirements files
  • sound banks
  • sound streams
  • configuration files
_________________________________________________________________________________

Sound file hierarchy:

--Level file - sound level file
------str - streams, contains list of audio streams - loads *.stm and *.st4 files - must be loaded through the LUA via an OpenAudioStream() line
------lvl - separate sub-levels, allows for separate loading of effects, music, foley, etc. - loads *.req files
----------bnk - sound banks, lists shorter, mono sounds - loads *.sfx and *.asfx files
----------config - sound configuration files - loads *.snd, *.mus and *.ffx files

_________________________________________________________________________________

Recommended sound specifications:

Ambient/music streams: Stereo, 44,100 to 48,000 Hz
Voice over streams: Mono, 22,050 Hz to 32,000 Hz
Effects: Mono, 22,050 to 44,100 Hz
Low-frequency effects: Mono, 10 Hz to 8,000 Hz

_________________________________________________________________________________

Audio buses:

Audio buses are a hierarchy of gain and attenuation controllers for audio. When a bus is attenuated, it is faded to a pre-specified gain whenever audio is sent through the attenuating bus. An example of bus attenuation is whenever in the stock game voice over announcements are played, the rest of the game's audio is faded until the voice over is finished.

Code: Select all

Bus()
{
    Name("voiceover"); // the name of the bus
    Gain(0.8); // the overall gain of the bus
    AttenuateBus("main"); // bus "main" is attenuated whenever audio is sent through this bus
    AttenuationLeadIn(0.5); // the amount of time in seconds for the attenuated bus to fade in
    AttenuationLeadOut(0.5); // the amount of time in seconds for the attenuated bus to fade out
    Attenuation(0.65); // the gain the bus is attenuated by
    Parent("ingame"); // the parent bus
    //Mute(); // mutes the bus
}
_________________________________________________________________________________

Requirements File Examples:

ME5.req
Hidden/Spoiler:
[code]ucft
{
REQN
{
"str"
"align=2048"
"ME5n_music" // in-game music
"ME5_ambiance" // in-map ambiance
"col_unit_vo_quick" // Collectors battle chatter
"gth_unit_vo_quick" // Geth battle chatter
"ssv_unit_vo_quick" // Alliance battle chatter
}
REQN
{
"lvl"
"ME5n" // sub-level for effects, configurations, etc.
}
}[/code]
ME5n.req
Hidden/Spoiler:
[code]ucft
{
REQN
{
"bnk"
"align=2048"
"ME5sfx" // sound effects
"ME5ffx" // foley effects
"me5_unit_vo" // unit pain voice overs
}

REQN
{
"config"
"me5_foley_metal_config" // foley base config
"me5_foley" // base foley group .ffx config
"me5_foley_metal" // metal foley class .ffx config

"ME5sounds" // all general battle sound effects
"me5_unit_vo" // voice overs

"ME5n_music_config" // in-game music
"ME5n_music" // .mus file for in-game music

"me5_bus" // custom bus hierarchy
}
}[/code]
_________________________________________________________________________________

Sound Bank File Example:

ME5sfx.asfx
Hidden/Spoiler:
[code]// ---Weapon Fire Start ---
effects\m3_fire.wav -resample xbox 44100 pc 44100 // resample sound's sample rate to 44,100 Hz
effects\m4_fire.wav -resample xbox 44100 pc 44100
effects\m6_fire.wav -resample xbox 44100 pc 44100
effects\m8_fire.wav -resample xbox 44100 pc 44100
effects\m9_fire.wav -resample xbox 44100 pc 44100
effects\m15_fire.wav -resample xbox 44100 pc 44100
effects\m23_fire.wav -resample xbox 44100 pc 44100
effects\m27_fire.wav -resample xbox 44100 pc 44100
effects\m76_fire.wav -resample xbox 44100 pc 44100
effects\m92_fire.wav -resample xbox 44100 pc 44100
effects\m97_fire.wav -resample xbox 44100 pc 44100
effects\m100_fire.wav -resample xbox 44100 pc 44100
effects\ml77_fire.wav -resample xbox 44100 pc 44100
effects\ml77_loop.wav -resample xbox 44100 pc 44100
effects\m451_fire.wav -resample xbox 44100 pc 44100
effects\m451_loop.wav -resample xbox 44100 pc 44100
effects\m451_close.wav -resample xbox 44100 pc 44100

effects\cloak_fire.wav -resample xbox 44100 pc 44100

effects\col_assaultrifle_fire.wav -resample xbox 44100 pc 44100
effects\col_beam_fire.wav -resample xbox 44100 pc 44100
effects\col_beam_loop.wav -resample xbox 44100 pc 44100

effects\pulse_rifle_fire.wav -resample xbox 44100 pc 44100
effects\siege_pulse_fire.wav -resample xbox 44100 pc 44100
effects\geth_punch_md.wav -resample xbox 44100 pc 44100
// ---Weapon Fire End ---


// ---Weapon Reload Start ---
effects\m3_reload.wav -resample xbox 44100 pc 44100
effects\m8_reload.wav -resample xbox 44100 pc 44100
effects\m23_reload.wav -resample xbox 44100 pc 44100
effects\m92_reload.wav -resample xbox 44100 pc 44100
// ---Weapon Reload End ---


// ---Weapon Foley Start ---
effects\sniper_scope_ambient.wav -resample xbox 44100 pc 44100
effects\sniper_scope_zoomin.wav -resample xbox 44100 pc 44100
effects\sniper_scope_zoomout.wav -resample xbox 44100 pc 44100
// ---Weapon Foley End ---


// ---Weapon Explosion Start ---
effects\m100_explosion.wav -resample xbox 44100 pc 44100
effects\ml77_explosion.wav -resample xbox 44100 pc 44100
effects\grenade_frag_explosion.wav -resample xbox 44100 pc 44100

effects\m100_explosion-sub.wav -resample xbox 8000 pc 8000 // resample sound's sample rate to 8,000 Hz, since all data over ~8,000 Hz is empty, wasteful junk data
effects\ml77_explosion-sub.wav -resample xbox 8000 pc 8000
effects\grenade_explosion_sub.wav -resample xbox 8000 pc 8000

effects\weap_bio_exp_lg-1.wav -resample xbox 44100 pc 44100
effects\weap_bio_exp_sm-1.wav -resample xbox 44100 pc 44100
effects\weap_bio_throw_exp.wav -resample xbox 44100 pc 44100
effects\weap_bio_warp_exp.wav -resample xbox 44100 pc 44100
effects\weap_bio_shockwave_exp.wav -resample xbox 44100 pc 44100
effects\weap_tech_fire_exp_md-1.wav -resample xbox 44100 pc 44100
effects\weap_tech_incinerate_exp.wav -resample xbox 44100 pc 44100
effects\weap_tech_overload_exp.wav -resample xbox 44100 pc 44100

effects\weap_bio_exp_lg-1-sub.wav -resample xbox 8000 pc 8000
effects\weap_bio_exp_sm-1-sub.wav -resample xbox 8000 pc 8000
effects\weap_tech_incinerate_exp-sub.wav -resample xbox 8000 pc 8000
// ---Weapon Explosion End ---[/code]
_________________________________________________________________________________

Sound Stream File Example:

ME5n_music.stm
Hidden/Spoiler:
[code]// ----- Ambient Bleed Music Variation 04 ----------
streams\ssv_music_04_start-01.wav ssv_amb_04_start-01 // alias (rename) "ssv_music_04_start-01.wav" to "ssv_amb_04_start-01" to call in .snd file
streams\ssv_music_04_start-02.wav ssv_amb_04_start-02
streams\ssv_music_04_start-03.wav ssv_amb_04_start-03

streams\ssv_music_04_mid-01.wav ssv_amb_04_mid-01
streams\ssv_music_04_mid-02.wav ssv_amb_04_mid-02
streams\ssv_music_04_mid-03.wav ssv_amb_04_mid-03

streams\ssv_music_04_end-01.wav ssv_amb_04_end-01
streams\ssv_music_04_end-02.wav ssv_amb_04_end-02 [/code]
_________________________________________________________________________________

Configuration Files Examples:

ME5sounds.snd
Hidden/Spoiler:
[code]///// ---Templates ---
SoundProperties()
{
Name("me5_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(50.0); // distance from source the sound will be muted
MaxDistance(50.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); //
}

///// ---Weapon Fire ---

SoundProperties()
{
Name("m8_rifle_fire"); // sound call name
Group("weapons"); // sound group
Inherit("me5_weapon_template"); // inherits config parameters from the "me5_weapon_template" template
SampleList()
{
Sample("m8_fire", 1.0); // "sampleNameFromSoundBank", Weight, PlayInterval, PlayIntervalDev (e.g., ("superKoolSampleYo", 1.0, 5.5, 0.5); the called sample would be played every 5 to 6 seconds))
}
}

SoundProperties()
{
Name("ml77_missile_loop");
Group("weapons");
Inherit("me5_weapon_template");
GainDev(0.0); // keep the gain the same every time the sound loops/plays
PitchDev(0.0); // keep the pitch the same every time the sound loops/plays
ModeDoppler(1); // uses doppler effects to simulate the pitch modulation from fast objects moving towards the listener
Looping(1); // because the sound is played for as long as the missile ordnance flies, the sound has to be looped, otherwise it would only play once
SampleList()
{
Sample("ml77_loop", 1.0);
}
}

SoundProperties()
{
Name("shepard_omniblade_scream");
Group("rep_vo"); // put sound in the "rep_vo" sound group
Inherit("me5_pain_chatter_template"); // inherit properties from the "me5_pain_chatter_template" template
Gain(1.0); // maintain maximum gain
PlayInterval(0.0);
PlayIntervalDev(0.0);
PlayProbability(1.0); // sound plays every time the attack is used
SampleList()
{
Sample("ssv_shepard_omniblade_01", 0.5); // 50% chance that sample one will play
Sample("ssv_shepard_omniblade_02", 0.5); // 50% chance that sample two will play
}
}

///// ---Weapon Foley ---

SoundProperties()
{
Name("me5_sniper_scope_ambient")
Pitch(1.0); // some sounds have very specific properties
PitchDev(0.0);
Gain(1.0);
GainDev(0.0);
ReverbGain(0.0);
Bus("soundfx");
Looping(1);
Pan(0.0);
Mode3D(0);
Bias(0.0001);
Priority(0.88);
SampleList()
{
Sample("sniper_scope_ambient", 1.0);
}
}

///// ---Weapon Explosion ---

SoundProperties()
{
Name("m100_grenade_explosion");
Group("Explosion");
Inherit("me5_explosion_template");
//Bus("me5_special_explosions"); // send to "me5_special_explosions" bus - commented out until custom bus hierarchy is working
MinDistance(55.0)
RollOff(6.0)
SpaceDistance(20);
SampleList()
{
Sample("m100_explosion", 1.0);
}
}

SoundProperties()
{
Name("m100_grenade_explosion-sub"); // the M-100 has a very-low-frequency (20-50 Hz) boom norm that plays at the same time as the normal explosion
Group("Explosion");
Inherit("me5_explosion_template");
//Bus("me5_special_explosions");
MinDistance(85.0)
RollOff(6.0)
SpaceDistance(20);
SampleList()
{
Sample("m100_explosion-sub", 1.0);
}
}

SoundLayered() // sounds can be layered, meaning they are all played at once together
{
Name("m100_grenade_explosion_layered"); // sound layer's call name - would go in the weapon explosion's ODF in a "SoundProperty" parameter
Layer("m100_explosion", "m100_grenade_explosion", 0.0); // ("layerName", "soundName", PlayInterval, PlayIntervalDev)
Layer("m100_explosion-sub", "m100_grenade_explosion-sub", 0.0);
}
// NOTE: When layering sounds, the sounds that are being layered MUST be above the SoundLayered() lines; also, it probably isn't necessary, but it would be best if the sounds are in the same order as the layers.
[/code]
ME5n_music_config.snd
Hidden/Spoiler:
[code]SoundStream()
{
Name("ssv_amb_04_start"); // call name for the sound stream segments
Pitch(1.0); // retain original pitch
PitchDev(0.0); // do not vary pitch
GainDev(0.0); // do not vary gain
ReverbGain(0.0); //
Bus("ingamemusic"); // send streams to "ingamemusic" bus
Looping(1); // loop segments
Pan(0.0); // retain original audio pan
Mode3D(0); //
CyclePlayback(3); // randomly selects segment but doesn't play same segment twice
Stream("ME5n_music"); // .stm/.st4 file to load streams from
SegmentList()
{
Segment("ssv_amb_04_start-01", 1.0, 0.0, 0.0);
Segment("ssv_amb_04_start-02", 1.0, 0.0, 0.0);
Segment("ssv_amb_04_start-03", 1.0, 0.0, 0.0);
}
}

SoundStream()
{
Name("ssv_amb_04_mid");
Pitch(1.0);
PitchDev(0.0);
GainDev(0.0);
ReverbGain(0.0);
Bus("ingamemusic");
Looping(1);
Pan(0.0);
Mode3D(0);
CyclePlayback(3);
Stream("ME5n_music");
SegmentList()
{
Segment("ssv_amb_04_mid-01", 1.0, 0.0, 0.0);
Segment("ssv_amb_04_mid-02", 1.0, 0.0, 0.0);
Segment("ssv_amb_04_mid-03", 1.0, 0.0, 0.0);
}
}

SoundStream()
{
Name("ssv_amb_04_end");
Pitch(1.0);
PitchDev(0.0);
GainDev(0.0);
ReverbGain(0.0);
Bus("ingamemusic");
Looping(1);
Pan(0.0);
Mode3D(0);
CyclePlayback(3);
Stream("ME5n_music");
SegmentList()
{
Segment("ssv_amb_04_end-01", 1.0, 0.0, 0.0);
Segment("ssv_amb_04_end-02", 1.0, 0.0, 0.0);
}
}[/code]
ME5n_music.mus
Hidden/Spoiler:
[code]Music()
{
Name("ssv_amb_04_start"); // name of music stream to be called from in LUA
Priority(1.0);
FadeInTime(1.2); // length of time in seconds that each stream fades out
FadeOutTime(1.2); // length of time in seconds that each stream fades in
MinPlaybackTime(10.0); // minimum length of time for which the stream has to play before another music stream may play
MaxPlaybackTime(360.0); // maximum length of time for which the stream has to play before another music stream may play
MinInactiveTime(0.0); // minimum length of time for which the stream may be inactive, I.E., not playing
SoundStream("ssv_amb_04_start"); // name of sound stream in .snd file to load streams from
}

Music()
{
Name("ssv_amb_04_mid");
Priority(1.0);
FadeInTime(1.2);
FadeOutTime(1.2);
MinPlaybackTime(10.0);
MaxPlaybackTime(290.0);
MinInactiveTime(0.0);
SoundStream("ssv_amb_04_mid");
}

Music()
{
Name("ssv_amb_04_end");
Priority(1.0);
FadeInTime(1.2);
FadeOutTime(1.2);
MinPlaybackTime(10.0);
MaxPlaybackTime(170.0);
MinInactiveTime(0.0);
SoundStream("ssv_amb_04_end");
}[/code]
Later to be addressed:
  • Buses [addressed]
  • Foley
  • Sound design techniques
  • Creating your own sound effects
  • Resources
Last edited by Marth8880 on Thu Apr 16, 2015 9:43 am, edited 6 times in total.
AcaelusThorne
Corporal
Corporal
Posts: 153
Joined: Tue Apr 26, 2011 3:30 am
Projects :: Republic Commando Side Mod
Games I'm Playing :: SWBII
xbox live or psn: No gamertag set

Re: Sound Research & Information

Post by AcaelusThorne »

Hey this looks very usefull (even though I just skimmed over it :) )
Can´t wait for :
"Sound design techniques" and "Creating your own sound effects".
Then I will have a nother closer look over the tutorial and try to actually bring a sound ingame.
Post Reply