This section contains examples of the contents of the sound.xml / soundai.xml file for various different situations.

 

 

Complete Sound XML Example

The example below shows a complete sound definition for an aircraft in Microsoft Flight Simulator 2024. After this we will show some shorter example code related to specific features from the sound XML:

<?xml version="1.0" encoding="utf-8" ?>
<SoundInfo Version="0.1">
    <WwisePackages>
        <MainPackage Name="Asobo_CRJ1000"/>
    </WwisePackages>
    <AcousticParameters>
        <Parameter Name="ReverberationPreset" ShareSetInside="rev_inside_default"/>
        <Parameter Name="Insulation_ExitClosed" Value="-24"/>
        <Parameter Name="Insulation_ExitOpen" Value="-12"/>
    </AcousticParameters>
    <AlwaysPlaySounds>
        <Sound WwiseData="true" WwiseEvent="YOKE_MOVEMENT" ViewPoint="Inside" NodeName="YOKE_PILONE_L_LOD00">
            <WwiseRTPC SimVar="YOKE X POSITION" Units="PERCENT" Index="0" Derived="true" RTPCName="SIMVAR_YOKE_X_POSITION_DERIVED"/>
            <WwiseRTPC SimVar="YOKE Y POSITION" Units="PERCENT" Index="0" Derived="true" RTPCName="SIMVAR_YOKE_Y_POSITION_DERIVED"/>
        </Sound>
        <Sound WwiseData="true" WwiseEvent="rattle_kinematic" >
            <WwiseRTPC SimVar="ROTATION VELOCITY BODY X" Units="PERCENT" Index="0" RTPCName="SIMVAR_ROTATION_VELOCITY_BODY_X"/>
            <WwiseRTPC SimVar="ROTATION VELOCITY BODY Y" Units="PERCENT" Index="0" RTPCName="SIMVAR_ROTATION_VELOCITY_BODY_Y"/>
            <WwiseRTPC SimVar="ROTATION VELOCITY BODY Z" Units="PERCENT" Index="0" RTPCName="SIMVAR_ROTATION_VELOCITY_BODY_Z"/>
        </Sound>
    </AlwaysPlaySounds>
    <WindSounds>
        <Sound WwiseEvent="wind_sound" WwiseData="true" />    
    </WindSounds>
    <GroundSounds>
        <Sound WwiseEvent="CENTER_TOUCHDOWN" FadeOutType="2" FadeOutTime="0.5" WwiseData="true" >
            <WwiseRTPC SimVar="WHEEL RPM" Units="RPM" Index="0" Derived="true" RTPCName="SIMVAR_WHEEL_RPM_DERIVED"/>
        </Sound> 
        <Sound WwiseEvent="LEFT_TOUCHDOWN" FadeOutType="2" FadeOutTime="0.5" WwiseData="true" >  
            <WwiseRTPC SimVar="WHEEL RPM" Units="RPM" Index="1" Derived="true" RTPCName="SIMVAR_WHEEL_RPM_DERIVED"/>
        </Sound>
        <Sound WwiseEvent="RIGHT_TOUCHDOWN" FadeOutType="2" FadeOutTime="0.5" WwiseData="true" >
            <WwiseRTPC SimVar="WHEEL RPM" Units="RPM" Index="2" Derived="true" RTPCName="SIMVAR_WHEEL_RPM_DERIVED"/>
        </Sound>
        <Sound WwiseEvent="GROUND_ROLL" WwiseData="true" FadeOutType="2" FadeOutTime="0.2"/>
        <Sound WwiseEvent="LEFT_WING_SCRAPE" WwiseData="true" />
        <Sound WwiseEvent="RIGHT_WING_SCRAPE" WwiseData="true" />
        <Sound WwiseEvent="FUSELAGE_SCRAPE" WwiseData="true" />
        <Sound WwiseEvent="CRASH_SOUND" WwiseData="true" />
        <Sound WwiseEvent="SPLASH_SOUND" WwiseData="true" />
    </GroundSounds>
    <MiscellaneousSounds>
        <Sound WwiseEvent="EXIT_OPEN" WwiseData="true" />
        <Sound WwiseEvent="GEAR_DOWN" WwiseData="true" />
        <Sound WwiseEvent="GEAR_UP" WwiseData="true" />
        <Sound WwiseEvent="FUEL_PUMP" WwiseData="true" />
        <Sound WwiseEvent="STALL_WARNING" WwiseData="true" />
        <Sound WwiseEvent="OVERSPEED_WARNING_SOUND" WwiseData="true" />
        <Sound WwiseEvent="NO_SMOKING_ALERT" WwiseData="true" />
        <Sound WwiseEvent="SEATBELTS_ALERT" WwiseData="true" />
    </MiscellaneousSounds>
    <EngineSoundPresets>
        <Sound WwiseEvent="Combustion" ConeHeading="180" WwiseData="true" EngineIndex="1" FadeOutType="2" FadeOutTime="5"/>
        <Sound WwiseEvent="Combustion" ConeHeading="180" WwiseData="true" EngineIndex="2" FadeOutType="2" FadeOutTime="5"/>
        <Sound WwiseEvent="JetWhine" WwiseData="true" EngineIndex="1" RPMMin="1"/>
        <Sound WwiseEvent="JetWhine" WwiseData="true" EngineIndex="2" RPMMin="1"/>
    </EngineSoundPresets>
    <SimVarSounds> 
        <Sound WwiseData="true" WwiseEvent="aileron_left" NodeName="AILERON_LEFT_LOD01" ContinuousStopDelay="1.0" SimVar="AILERON POSITION" Units="PERCENT" Index="1">
            <WwiseRTPC SimVar="AILERON POSITION" Units="PERCENT" Index="1" RTPCName="SIMVAR_AILERON_POSITION" />
        </Sound>
        <Sound WwiseData="true" WwiseEvent="aileron_right" NodeName="AILERON_RIGHT_LOD01" ContinuousStopDelay="1.0" SimVar="AILERON POSITION" Units="PERCENT" Index="0">
            <WwiseRTPC SimVar="AILERON POSITION" Units="PERCENT" Index="0" RTPCName="SIMVAR_AILERON_POSITION" />
        </Sound>
        <Sound WwiseData="true" WwiseEvent="rudder" NodeName="RUDDER_LOD01" ContinuousStopDelay="1.0" SimVar="RUDDER POSITION" Units="PERCENT" Index="0">
            <WwiseRTPC SimVar="RUDDER POSITION" Units="PERCENT" Index="0" RTPCName="SIMVAR_RUDDER_POSITION" />
        </Sound>
        <Sound WwiseData="true" WwiseEvent="elevator" NodeName="ELEVATOR_TRIM_LEFT_LOD01" ContinuousStopDelay="1.0" SimVar="ELEVATOR POSITION" Units="PERCENT" Index="0">
            <WwiseRTPC SimVar="ELEVATOR POSITION" Units="PERCENT" Index="0" RTPCName="SIMVAR_ELEVATOR_POSITION" />
        </Sound>
        <Sound WwiseData="true" WwiseEvent="flaps_left" NodeName="FLAP_LEFT04A_LOD00" ContinuousStopDelay="1.0" SimVar="TRAILING EDGE FLAPS LEFT PERCENT" Units="PERCENT" Index="0">
            <Requires SimVar="FLAP DAMAGE BY SPEED" Units="BOOL" Index="0">
                <Range UpperBound="0" />
            </Requires>    
            <WwiseRTPC SimVar="TRAILING EDGE FLAPS LEFT PERCENT" Units="PERCENT" Derived="true" Index="0" RTPCName="SIMVAR_TRAILING_EDGE_FLAPS_LEFT_PERCENT_DERIVED" />
        </Sound>
        <Sound WwiseData="true" WwiseEvent="flaps_right" NodeName="FLAP_RIGHT04A_LOD00" ContinuousStopDelay="1.0" SimVar="TRAILING EDGE FLAPS RIGHT PERCENT" Units="PERCENT" Index="0">
            <Requires SimVar="FLAP DAMAGE BY SPEED" Units="BOOL" Index="0">
                <Range UpperBound="0" />
            </Requires>    
            <WwiseRTPC SimVar="TRAILING EDGE FLAPS RIGHT PERCENT" Units="PERCENT" Derived="true" Index="0" RTPCName="SIMVAR_TRAILING_EDGE_FLAPS_RIGHT_PERCENT_DERIVED" />
        </Sound>
        <Sound WwiseEvent="GEAR_MOVEMENT" WwiseData="true" FadeOutType="2" FadeOutTime="0.1" SimVar="GEAR TOTAL PCT EXTENDED" Units="PERCENT">
            <WwiseRTPC SimVar="GEAR TOTAL PCT EXTENDED" Units="PERCENT" Index="0" RTPCName="SIMVAR_GEAR_TOTAL_PCT_EXTENDED" />
            <WwiseRTPC SimVar="GEAR TOTAL PCT EXTENDED" Units="PERCENT" Derived="true" Index="0" RTPCName="SIMVAR_GEAR_TOTAL_PCT_EXTENDED_DERIVED" />
        </Sound>
        <Sound WwiseData="true" WwiseEvent="lever_throttle" ViewPoint="Inside" NodeName="LEVER_THROTTLE_1_LOD00" ContinuousStopDelay="1.0" SimVar="GENERAL ENG THROTTLE LEVER POSITION" Units="PERCENT" Index="1">
            <WwiseRTPC SimVar="GENERAL ENG THROTTLE LEVER POSITION" Units="PERCENT" Index="1" Derived="true" RTPCName="SIMVAR_GENERAL_ENG_THROTTLE_LEVER_POSITION_DERIVED" />
        </Sound>
        <Sound WwiseData="true" WwiseEvent="pedal_movement" ViewPoint="Inside" NodeName="YOKE_L" ContinuousStopDelay="1.0" SimVar="RUDDER PEDAL POSITION" Units="PERCENT" Index="0">
            <WwiseRTPC SimVar="RUDDER PEDAL POSITION" Units="PERCENT" Index="0" Derived="true" RTPCName="SIMVAR_RUDDER_PEDAL_POSITION_DERIVED" />
        </Sound>
        <Sound WwiseData="true" WwiseEvent="rattle_ground" ViewPoint="Inside" FadeOutType="2" FadeOutTime="0.5" ContinuousStopDelay="0.5" SimVar="SIM ON GROUND" Units="BOOLEAN" Index="0">
            <Range LowerBound="1.0" />
            <Requires SimVar="GROUND VELOCITY" Units="METERS PER SECOND" Index="0">
                <Range LowerBound="0.1" />
            </Requires>
            <WwiseRTPC SimVar="GROUND VELOCITY" Units="METERS PER SECOND" Index="0" RTPCName="SIMVAR_GROUND_VELOCITY" />
            <WwiseRTPC SimVar="SURFACE TYPE" Units="ENUM" Index="0" RTPCName="SIMVAR_SURFACE_TYPE" />
            <WwiseRTPC SimVar="GENERAL ENG COMBUSTION SOUND PERCENT" Units="PERCENT OVER 100" Index="1" RTPCName="SIMVAR_GENERAL_ENG_COMBUSTION_SOUND_PERCENT" />      
        </Sound>   
        <Sound WwiseData="true" WwiseEvent="rain_sound" SimVar="AMBIENT PRECIP RATE" Units="millimeters of water" Index="0"> 
            <Range LowerBound="0.1" />
            <WwiseRTPC SimVar="AMBIENT PRECIP RATE" Units="millimeters of water" Index="0" RTPCName="SIMVAR_AMBIENT_PRECIP_RATE"/> 
            <WwiseRTPC SimVar="AIRSPEED INDICATED" Units="KNOTS" Index="0" RTPCName="SIMVAR_AIRSPEED_INDICATED"/> 
        </Sound>
    </SimVarSounds>
</SoundInfo>

 

 

Wwise Package Definition Examples

When using WwisePackages, the definition should be done at the start of the XML using the <WwisePackages> element, like this:

<WwisePackages>
    <MainPackage Name="MyCompany_MyAircraft"/>
    <AdditionalPackage Name="MyCompany_MyAircraft_Additional1"/>
    <AdditionalPackage Name="MyCompany_MyAircraft_Additional2"/>
</WwisePackages>

If this element is not specified, the name of the package loaded in game will be deduced by the path of sound.xml file.

 

 

Acoustic Parameters Example

Below is an example using the <AcousticParameters> element to set up sharsets:

<AcousticParameters>
    
    <Parameter Name="ReverberationPreset" ShareSetInside="shareset_inside_name" ShareSetOutide="shareset_outside_name"/>
</AcousticParameters>

 

Below is an example using the <AcousticParameters> element to set up audio attenuation:

<AcousticParameters>
    
    <Parameter Name="Insulation_ExitClosed" Value="-22"/>
    
    <Parameter Name="Insulation_ExitOpen" Value="-12"/>
</AcousticParameters>

 

 

Engine Preset Examples

Below is an example using the <EngineSoundPresets> element to set up sound presets for engines:

<EngineSoundPresets>
    
    <Sound WwiseEvent="Combustion" ConeHeading="225" RPMMin="675" WwiseData="true" EngineIndex="3"/>
     
    <Sound WwiseEvent="Shutdown" ConeHeading="225" RPMMin="675" WwiseData="true" EngineIndex="3"/>
    
    <Sound WwiseEvent="Combustion" CustomSuffix="from_left" ConeHeading="225" RPMMin="675" WwiseData="true" EngineIndex="3"/>
     -->
    <Sound WwiseEvent="Shutdown" CustomSuffix="from_left" ConeHeading="225" RPMMin="675" WwiseData="true" EngineIndex="3"/>
</EngineSoundPresets>

The following presets example is specific to helicopters:

<EngineSoundPresets>
    
    <Sound WwiseEvent="Rotor" FadeOutType="2" FadeOutTime="1" WwiseData="true" RPMMin="285" RotorIndex="1" EngineIndex="1"  />
    
    <Sound WwiseEvent="Rotor" ConeHeading="90"  FadeOutType="2" FadeOutTime="1" WwiseData="true" RPMMin="2770" RotorIndex="2" EngineIndex="1" />
</EngineSoundPresets>

The following example shows the setup for exterior engine audio to be linked to doors, so that the audio in the cockpit will change if a door to the exterior is opened or closed (for more information please see here: Engine Audio When The Cockpit Is Open):

  <EngineSoundPresets>
    <Sound WwiseEvent="Combustion" ConeHeading="180" FadeOutType="2" FadeOutTime="0.5" RPMMin="675" WwiseData="true" EngineIndex="1" >
        <WwiseRTPC SimVar="GENERAL ENG COMBUSTION SOUND PERCENT" Units="PERCENT OVER 100" RTPCReleaseTime="0.5" Index="1" RTPCName="SIMVAR_GENERAL_ENG_COMBUSTION_SOUND_PERCENT" />
        <WwiseRTPC SimVar="INTERACTIVE POINT OPEN" Units="PERCENT OVER 100" Index="0"  RTPCName="SIMVAR_INTERACTIVE_POINT_OPEN_0" />
        <WwiseRTPC SimVar="INTERACTIVE POINT OPEN" Units="PERCENT OVER 100" Index="1"  RTPCName="SIMVAR_INTERACTIVE_POINT_OPEN_1" />
    </Sound>
    <Sound WwiseEvent="Combustion" CustomSuffix="Exhaust" ConeHeading="225" FadeOutType="2" FadeOutTime="0.5" RPMMin="675" WwiseData="true" ViewPoint="Outside" EngineIndex="1" >
        <WwiseRTPC SimVar="GENERAL ENG COMBUSTION SOUND PERCENT" Units="PERCENT OVER 100" RTPCReleaseTime="0.5" Index="1" RTPCName="SIMVAR_GENERAL_ENG_COMBUSTION_SOUND_PERCENT" />
    </Sound>
    <Sound WwiseEvent="Starter" FadeOutType="2" FadeOutTime="0.1" WwiseData="true" EngineIndex="1" >  
        <WwiseRTPC SimVar="GENERAL ENG COMBUSTION SOUND PERCENT" Units="PERCENT OVER 100" RTPCReleaseTime="0.5" Index="1" RTPCName="SIMVAR_GENERAL_ENG_COMBUSTION_SOUND_PERCENT" />
        <WwiseRTPC SimVar="INTERACTIVE POINT OPEN" Units="PERCENT OVER 100" Index="0"  RTPCName="SIMVAR_INTERACTIVE_POINT_OPEN_0" />
        <WwiseRTPC SimVar="INTERACTIVE POINT OPEN" Units="PERCENT OVER 100" Index="1"  RTPCName="SIMVAR_INTERACTIVE_POINT_OPEN_1" />
    </Sound>
    <Sound WwiseEvent="CombustionStart" ConeHeading="180" WwiseData="true" EngineIndex="1" > 
        <WwiseRTPC SimVar="GENERAL ENG COMBUSTION SOUND PERCENT" Units="PERCENT OVER 100" RTPCReleaseTime="0.5" Index="1" RTPCName="SIMVAR_GENERAL_ENG_COMBUSTION_SOUND_PERCENT" />
        <WwiseRTPC SimVar="INTERACTIVE POINT OPEN" Units="PERCENT OVER 100" Index="0"  RTPCName="SIMVAR_INTERACTIVE_POINT_OPEN_0" />
        <WwiseRTPC SimVar="INTERACTIVE POINT OPEN" Units="PERCENT OVER 100" Index="1"  RTPCName="SIMVAR_INTERACTIVE_POINT_OPEN_1" />
    </Sound>
    <Sound WwiseEvent="CombustionStart" CustomSuffix="Propeller" ConeHeading="0" WwiseData="true" EngineIndex="1" >  
        <WwiseRTPC SimVar="GENERAL ENG COMBUSTION SOUND PERCENT" Units="PERCENT OVER 100" RTPCReleaseTime="0.5" Index="1" RTPCName="SIMVAR_GENERAL_ENG_COMBUSTION_SOUND_PERCENT" />
        <WwiseRTPC SimVar="INTERACTIVE POINT OPEN" Units="PERCENT OVER 100" Index="0"  RTPCName="SIMVAR_INTERACTIVE_POINT_OPEN_0" />
        <WwiseRTPC SimVar="INTERACTIVE POINT OPEN" Units="PERCENT OVER 100" Index="1"  RTPCName="SIMVAR_INTERACTIVE_POINT_OPEN_1" />
    </Sound>
    <Sound WwiseEvent="Shutdown" ConeHeading="180" RPMMin="675" WwiseData="true" EngineIndex="1" >  
        <WwiseRTPC SimVar="GENERAL ENG COMBUSTION SOUND PERCENT" Units="PERCENT OVER 100" RTPCReleaseTime="0.5" Index="1" RTPCName="SIMVAR_GENERAL_ENG_COMBUSTION_SOUND_PERCENT" />
        <WwiseRTPC SimVar="INTERACTIVE POINT OPEN" Units="PERCENT OVER 100" Index="0"  RTPCName="SIMVAR_INTERACTIVE_POINT_OPEN_0" />
        <WwiseRTPC SimVar="INTERACTIVE POINT OPEN" Units="PERCENT OVER 100" Index="1"  RTPCName="SIMVAR_INTERACTIVE_POINT_OPEN_1" />
    </Sound>
    <Sound WwiseEvent="Shutdown" CustomSuffix="Propeller" ConeHeading="0" RPMMin="675" WwiseData="true" EngineIndex="1" >  
        <WwiseRTPC SimVar="GENERAL ENG COMBUSTION SOUND PERCENT" Units="PERCENT OVER 100" RTPCReleaseTime="0.5" Index="1" RTPCName="SIMVAR_GENERAL_ENG_COMBUSTION_SOUND_PERCENT" />
        <WwiseRTPC SimVar="INTERACTIVE POINT OPEN" Units="PERCENT OVER 100" Index="0"  RTPCName="SIMVAR_INTERACTIVE_POINT_OPEN_0" />
        <WwiseRTPC SimVar="INTERACTIVE POINT OPEN" Units="PERCENT OVER 100" Index="1"  RTPCName="SIMVAR_INTERACTIVE_POINT_OPEN_1" />
    </Sound>
    <Sound WwiseEvent="Propeller" ConeHeading="0" FadeOutType="2" FadeOutTime="0.5" RPMMin="675" WwiseData="true" EngineIndex="1" >
        <WwiseRTPC SimVar="GENERAL ENG COMBUSTION SOUND PERCENT" Units="PERCENT OVER 100" RTPCReleaseTime="0.5" Index="1" RTPCName="SIMVAR_GENERAL_ENG_COMBUSTION_SOUND_PERCENT" />
        <WwiseRTPC SimVar="INTERACTIVE POINT OPEN" Units="PERCENT OVER 100" Index="0"  RTPCName="SIMVAR_INTERACTIVE_POINT_OPEN_0" />
        <WwiseRTPC SimVar="INTERACTIVE POINT OPEN" Units="PERCENT OVER 100" Index="1"  RTPCName="SIMVAR_INTERACTIVE_POINT_OPEN_1" />
    </Sound>
  </EngineSoundPresets>

 

Engine State And Transition Examples

Below is an example using the <EngineSoundStates> element to link sounds with an engine:

<EngineSoundStates>
    
    <Sound WwiseEvent="MySound" WwiseData="true" EngineIndex="1"  StateOff="false" StateStart="true" StateOn="true" />
</EngineSoundStates>

 

The following example is for setting a transition sound for an engine using the <EngineSoundTransitions> element:

<EngineSoundTransitions>
    
    <Sound WwiseEvent="MySound" WwiseData="true" StateFrom="Start" StateTo="On"  EngineIndex="2"/>
</EngineSoundTransitions>

 

 

Miscellaneous Sounds Example

The short example below shows how the <MiscellaneousSounds> element can be used:

<MiscellaneousSounds>
    <Sound WwiseEvent="STALL_WARNING" WwiseData="true" />
    <Sound WwiseEvent="OVERSPEED_WARNING_SOUND" WwiseData="true" />
    <Sound WwiseEvent="AP_PREFLIGHT_CHECK_OVER" WwiseData="true" /> 
</MiscellaneousSounds>

 

 

SimVar Sounds Examples

The short example below shows how the <SimVarSounds> element can be used:

<SimVarSounds>
    
    <Sound WwiseEvent="Sound_For_Test_1" WwiseData="true" SimVar="SIMVAR TEST 1" Units="PERCENT" Index="0"/>
    
    <Sound WwiseEvent="Sound_For_Test_2" WwiseData="true" SimVar="SIMVAR TEST 2" Units="PERCENT" Index="0">
        <Range LowerBound="10.0" UpperBound="15.0"/>
        <Range LowerBound="25.0" />
    </Sound>
</SimVarSounds>

 

In addition to the <Range /> elements, the <Requires> element allows to add other SimVar or LocalVar conditions on a sound to be played:

<SimVarSounds>
    
    <Sound WwiseEvent="Sound_For_Test_2" WwiseData="true" SimVar="SIMVAR TEST 1" Units="PERCENT" Index="0">
        <Range LowerBound="10.0" UpperBound="15.0"/>
        <Range LowerBound="25.0" />
        <Requires SimVar="SIMVAR TEST 2" Units="PERCENT" Index="0">
            <Range LowerBound="60" />
        </Requires>
        <Requires SimVar="SIMVAR TEST 3" Units="PERCENT" Index="0"></Requires>
    </Sound>
</SimVarSounds>

 

 

Local Variables

Instead of using the SimVar attribute for the <Sound> element, you can set up local variables as conditions to play a sound using the LocalVarEX1 attribute. This works the same way as the SimVar attribute, except it requires no additional Units and Index attributes:

<SimVarSounds>
    
    <Sound WwiseEvent="Sound_For_Test" WwiseData="true" LocalVarEX1="MyLocalVar TEST 1" >
        <Range LowerBound="0.1" UpperBound="0.15"/>
        <Range LowerBound="0.25" />
        <Requires LocalVarEX1="MyLocalVar TEST 2">
            <Range LowerBound="1" />
        </Requires>
    </Sound>
</SimVarSounds>

In addition to previously mentioned attributes, ContinuousStopDelay can be set to a value in seconds and will delay the stop of the continuous sound linked to the SimVar after the condition for stopping has been reached.

NOTE
For a list of all simulation variables with their units and indices, visit the Simulation Variables section of the documentation.

 

 

Animation

The <SimVarSounds> container element can be used to define sounds that will be played based on an animation, for example:

<SimVarSounds>
    <Sound WwiseData="true" WwiseEvent="sunshield_left_stops" Animation="Sunshield_L" Model="Interior" ViewPoint="Inside" NodeName="Sunshield_L_BASE" ContinuousStopDelay="1" Continuous="false" >
        <Range Lowerbound="0.9"/>
        <Range UpperBound="0.1"/>
        <WwiseRTPC Animation="Sunshield_L" Model="Interior" Derived="true" RTPCName="ANIMATION_SUNSHIELD_MOVEMENTS_DERIVED" RTPCAttackTime="0.1" RTPCReleaseTime="0.1"/>
    </Sound>
</SimVarSounds>

 

 

InputEvents

You can also associate a sound effect with an Input Event using SimVar sounds:

<SimVarSounds>
    <Sound WwiseEvent="fuel_pump1_on" WwiseData="true" FadeOutType="2" FadeOutTime="0.2" InputEvent="FUEL_Pump_1" Units="Number">
        <Range UpperBound="0"/>
        <Requires SimVar="ELECTRICAL MASTER BATTERY" Units="BOOLEAN" Index="1">
            <Range LowerBound="1" />
        </Requires>
    </Sound>
</SimVarSounds>

 

 

Derived Values

When working with SimVar sounds, you can use a derived value to trigger the sound effect, as shown in the following examples.

 

This sound will play whenever the derived value of the SimVar is changing:

<SimVarSounds>
    <Sound WwiseEvent="Sound_For_Test_1" WwiseData="true" SimVar="SIMVAR TEST 1" Units="PERCENT" Index="0" Derived="true"/>
</SimVarSounds>

 

 

This sound will play whenever the derived value of the SimVar is between -10 and -1, and when the value reaches 25 when rising:

<SimVarSounds>
    <Sound WwiseEvent="Sound_For_Test_2" WwiseData="true" SimVar="SIMVAR TEST 2" Units="PERCENT" Index="0" Derived="true">
        <Range LowerBound="-10.0" UpperBound="-1"/>
        <Range LowerBound="25.0" />
    </Sound>
</SimVarSounds>

 

This sound will play whenever the derived value of the SimVar is between -10 and -1, and when the value reaches 0 when falling:

<SimVarSounds>
    <Sound WwiseEvent="Sound_For_Test_2" WwiseData="true" SimVar="SIMVAR TEST 2" Units="PERCENT" Index="0" Derived="true">
        <Range LowerBound="-10.0" UpperBound="-1"/>
        <TriggerValue Value="0" Downward="True"/>
    </Sound>
</SimVarSounds>

 

 

Parameters

When working with SimVar sounds, it is possible that the SimVar you wish to use requires more than a single index to be passed through to it to get a specific value. In these cases you can use the ParamN attribute within the <Sound> declaration. When using this attribute it is worth noting the following:

  • The first parameter (Param0) can be given in different ways and in all forms is the initial index for the SimVar being used. The three methods of defining this index is as follows:

    • In the SimVar attribute as

      SimVar="<SimVarName>:<Index>"
    • In an Index attribute as

      Index="<Index>"
    • In a Param0 attribute as:

      Param0="<Index>"
  • Further parameters are given as Param1, Param2, Param3, etc… The identifying value N needs to be given in consecutive order, and has to start at 0 or 1 (Param0 being optional, as explained above).

  • Names in parameters are supported, meaning that you can pass in a parameter name insead of a fixed value. Note that the name must be surrounded with single quoates and include a _n suffix, For example:

    Param1="'ParamName'_n"

 

The snippet below shows a SimVar sound trigger being defined using the ParamN attribute:

<SimVarSounds>
    <Sound WwiseData="true" WwiseEvent="wear_and_tear_break" SimVar="WEAR AND TEAR IS WEAK" Units="BOOL" Param0="'brake'_n" Param1="'wheel_left'_n"/>
</SimVarSounds

 

 

Event ID Example

The short example below shows how the <EventIdSounds> element can be used:

<EventIdSounds>
    
    <Sound WwiseEvent="Sound_For_Test_1" WwiseData="true" EventId="KEY_TEST_EVENT_1"/>
    
    <Sound WwiseEvent="Sound_For_Test_2" WwiseData="true"  EventId="KEY_TEST_EVENT_2" ChangedOnly="true"/>        
</EventIdSounds>

 

 

Animation Sounds Example

To fully give an example of the <AnimationSounds> element, we must first give some details of how the XML for the animation itself should be created. This is done under the <Behaviors> element of the [model].xml file, using an <AnimationTrigger> element, or within a <Component>. Within the <AnimationTrigger> element you would then have the <EventTrigger> sub-element, then finally, within the <EventTrigger> element you would have the <SoundEvent /> self-closing sub-element. If we put all this together, we have entries in the <Behaviors> element that looks like this:

<AnimationTriggers Animation="MyAnimationName1">
    
    <EventTrigger Count="2" Direction="Both">
        <SoundEvent WwiseEvent="MySound1" Action="Play"/>
    </EventTrigger>
</AnimationTriggers>
<AnimationTriggers Animation="MyAnimationName2">
    
    <EventTrigger NormalizedTime="0.1" Direction="Forward">
        <SoundEvent WwiseEvent="MySound2" Action="Play"/>
    </EventTrigger>
    <EventTrigger NormalizedTime="0.9" Direction="Backward">
        <SoundEvent WwiseEvent="MySound2" Action="Play"/>
    </EventTrigger>
</AnimationTriggers>

 

Finally, in the sound.xml file we can use the <AnimationSounds> element to trigger the sound:

<AnimationSounds>
    
    <Sound WwiseData="true" WwiseEvent="MySound" ViewPoint="Inside"/>
</AnimationSounds>

 

You can find full details on how to set up animation sounds on the following page:

 

 

Avionic Sounds Example

When triggering a sound from an instrument, it must be defined using the same WwiseEvent ID string in both the instrument XML and the sound.xml file. Below is an example of sounds being defined for a panel:

<Alert>
    <Type>SoundOnly</Type>
    <SoundEvent>voice_alert_500ft</SoundEvent>
    <Condition>
        <StateMachine>
            <State id="Under" value="0">
                <Transition to="Over">
                    <GreaterEqual>
                        <Simvar name="PLANE ALT ABOVE GROUND" unit="feet"/>
                        <Constant>500</Constant>
                    </GreaterEqual>
                </Transition>
            </State>
            <State id="Over" value="0">
                <Transition to="Alerting">
                    <Lower>
                        <Simvar name="PLANE ALT ABOVE GROUND" unit="feet"/>
                        <Constant>500</Constant>
                    </Lower>
                </Transition>
            </State>
            <State id="Alerting" value="1">
                <Transition to="Under">
                    <Constant>1</Constant>
                </Transition>
            </State>
        </StateMachine>
    </Condition>
</Alert>

The sound would then be defined under the <AvionicSounds> element like this:

<AvionicSounds> 
    <Sound WwiseData="true" WwiseEvent="voice_alert_500ft" />
</AvionicSounds>