• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

xml sound

Messages
118
Country
israel
Hi

I try to play sound using xml sound gauge onky once when the aircraft pass 56 kts, I dont know how to "tell" the gauge to play the sound once...

the resault is if i stay at 56 kts the sound play again and again...

<Element>
<Select>
<Value>
{ (A:AIRSPEED INDICATED, knots) 56 ==
(A:IS SLEW ACTIVE,bool) ! &amp;&amp;
(A:SIM ON GROUND,bool) ! &amp;&amp;
if{ 2 (&gt;L:GH_Sound03,number) }
els{ 0 (&gt;L:GH_Sound03,number) }
</Value>
</Select>
</Element>
 
Are you using Doug dawson's sound gauge?

This is what the manual says about controlling the sounds;
Gauge control variables can use the following values:
0 - Stop Sound
1 - Play sound once, without changing the existing volume or pan settings.
2 - Play sound as a loop, without changing the existing volume or pan settings.
3 - Set the sound's volume, using the setting found in the specified VolumeIn variable, see below.
4 - Get the sound's current volume setting, placing it in the specified VolumeOut variable.
5 - Set the sound's pan, using the setting found in the specified PanIn variable.
6 - Get the sound's current pan setting, placing it in the specified PanOut variable.
7 - Play sound once, but first set the volume and pan to the settings found in the VolumeIn and PanIn variables.
8 - Play sound as a loop, but first set the volume and pan to the settings found in the VolumeIn and PanIn variables.
9 - Get sound's looping status. Will return 1 if a playing sound is looping, 0 if the sound is in play once mode or is not playing at all.
10 – Unload a sound. Sounds will be automatically unloaded on gauge exit, but if the sound file is large, and you are done with it, you might want to unload it immediately, and reclaim the memory.
Just assign the proper value to the sound's Lvar and the action associated will be carried out.
 
Here is an example of playing a sound once. If you are not using Doug Dawsons sound gauge, I would strongly recommend that you start. You can Download it at his site:

http://www.douglassdawson.ca/

Hope this helps you out.

Cheers
Greg

Code:
<Gauge Name="annunciator_Cargo_Ramp" Version="1.0">
  <Size X="118" Y="59"/>
  <Update Hidden="Yes">
    (A:Exit Open,percent) 0 &gt;
    (L:PlayOnce,bool) 0 == and
     if{ 
      1 (&gt;L:dsd_fsx_sound_id_00,number) 
      1 (&gt;L:PlayOnce,bool)
      }

    (A:Exit Open,percent) 0 ==
    (L:PlayOnce,bool) 1 == and
    if{ 0 (&gt;L:PlayOnce,bool) }
  </Update>
  <Element>
    <Select>
      <Failures>
        <SYSTEM_ELECTRICAL_PANELS Action="0"/>
      </Failures>
      <Value>
        (A:Exit Open,percent) 0 &gt; if{ 1 } els{ 0 }
      </Value>
      <Case Value="0">
        <Image Name="Cargo_Closed.bmp"
        UseTransparency="Yes"/>
      </Case>
      <Case Value="1">
        <Image Name="Cargo_Open.bmp" Bright="Yes"
        UseTransparency="Yes"/>
      </Case>
    </Select>
  </Element>
</Gauge>
 
Last edited:
You can use this for "80kts" callout at 80.
you can get the whole gauge for different callouts at avsim.
http://library.avsim.net/search.php?SearchTerm=b200&CatID=fsxsnds&Go=Search
this might give you an idea..


Code:
<Update Frequency="4"/>

<!-- Set Vspeeds sounds -->
<Element>
  <Select>
    <Value>

        (A:SIM ON GROUND,bool) 1 ==
        if{
        (A:AIRSPEED INDICATED,knots) 80 &gt;=
        (L:Speedvariable) 80 &lt; &amp;&amp;
        if{ 1 (&gt;L:VSPEED_Sound_V80,enum) }

        (A:AIRSPEED INDICATED,knots) (&gt;L:Speedvariable)
  	}

    </Value>
  </Select>
</Element>
 
Last edited:
Hi thanks all,

I tried to code:

<Element>
<Select>
<Value>
{ (A:AIRSPEED INDICATED, knots) 56 (A:G FORCE, Gforce) abs sqrt * (A:Trailing edge flaps0 left percent,percent) 0.05 * - &lt;
(A:IS SLEW ACTIVE,bool) ! &amp;&amp;
(A:SIM ON GROUND,bool) ! &amp;&amp;
(A:AIRSPEED INDICATED, knots) 42 &lt; ! &amp;&amp;
(A:PLANE PITCH DEGREES, degrees) 8 &gt; ! &amp;&amp;
if{ 1 (&gt;L:GH_Sound03,number) }
els{ 0 (&gt;L:GH_Sound03,number) }
</Value>
</Select>
</Element>

I used 1 parameter and the sounds play on loop. I dont know whats wrong
 
Read the replies more carefully.

Note this variable? (L:PlayOnce,bool)

This is a "flag variable" that is set true once the sound has played one time.
 
also I try to use (L:PlayOnce,bool)


<Element>
<Select>
<Value>
{ (A:AIRSPEED INDICATED, knots) 56 (A:G FORCE, Gforce) abs sqrt * (A:Trailing edge flaps0 left percent,percent) 0.05 * - &lt;
(L:PlayOnce,bool) 0 == and
(A:IS SLEW ACTIVE,bool) ! &amp;&amp;
(A:SIM ON GROUND,bool) ! &amp;&amp;
(A:AIRSPEED INDICATED, knots) 42 &lt; ! &amp;&amp;
(A:PLANE PITCH DEGREES, degrees) 8 &gt; ! &amp;&amp;
if{
1 (&gt;L:GH_Sound03,number)
1 (&gt;L:PlayOnce,bool)
}

</Value>
</Select>
</Element>

the resault is that the sound play once but for 0.01 sec (not all of the file length)
 
<Element>
<Select>
<Value>
{ (A:AIRSPEED INDICATED, knots) 56 (A:G FORCE, Gforce) abs sqrt * (A:Trailing edge flaps0 left percent,percent) 0.05 * - &lt;
(L:PlayOnce,bool) 0 == and
(A:IS SLEW ACTIVE,bool) ! &amp;&amp;
(A:SIM ON GROUND,bool) ! &amp;&amp;
(A:AIRSPEED INDICATED, knots) 42 &lt; ! &amp;&amp;
(A:PLANE PITCH DEGREES, degrees) 8 &gt; ! &amp;&amp;
if{
1 (&gt;L:GH_Sound03,number)
1 (&gt;L:PlayOnce,bool)
}

</Value>
</Select>
</Element>


just guessing, but could it be the "{" at the begining of your code? And someone correct me if I am wrong, but you may also need a update to reset the sound after it has triggered. Once again I am just guessing. Hope it helps

Greg
 
also I try to use (L:PlayOnce,bool)
<Element>
<Select>
<Value>
{ (A:AIRSPEED INDICATED, knots) 56 (A:G FORCE, Gforce) abs sqrt * (A:Trailing edge flaps0 left percent,percent) 0.05 * - &lt;
(L:PlayOnce,bool) 0 == and
(A:IS SLEW ACTIVE,bool) ! &amp;&amp;
(A:SIM ON GROUND,bool) ! &amp;&amp;
(A:AIRSPEED INDICATED, knots) 42 &lt; ! &amp;&amp;
(A:PLANE PITCH DEGREES, degrees) 8 &gt; ! &amp;&amp;
if{
1 (&gt;L:GH_Sound03,number)
1 (&gt;L:PlayOnce,bool)
}

</Value>
</Select>
</Element>

the resault is that the sound play once but for 0.01 sec (not all of the file length)

There is nothing in the code you quote that will stop a playing sound. If the sound is not being played through to the end, then it is being turned off somewhere else. You will need to look at the rest of your gauge code - not necessarily just in that gauge.

Doug
 
see my post above how to reset the value in the code section I listed..
once the speed goes below 80 it is reset so the next time you landed and takeoff and go past 80, the callout is being played.

Work like a charm.
 
I dont understand what goes wrong...

I try this code:

<Update Frequency="4"/>

<!-- Set Vspeeds sounds -->
<Element>
<Select>
<Value>

(A:SIM ON GROUND,bool) 1 ==
if{
(A:AIRSPEED INDICATED,knots) 80 &gt;=
(L:Speedvariable) 80 &lt; &amp;&amp;
if{ 1 (&gt;L:GH_Sound03,enum) }

(A:AIRSPEED INDICATED,knots) (&gt;L:Speedvariable)
}

</Value>
</Select>
</Element>

(ini)

[Config]
MaxSounds=11
LvarStop=GH_SoundStop


[Sounds]
Sound00=./Sound/c172sounds/rudder.wav,100
Sound01=./Sound/c172sounds/flaps30.wav,100
Sound02=./Sound/c172sounds/c172_stallhorn.wav,100
Sound03=./Sound/c172sounds/brakes.wav,100
Sound04=./Sound/c172sounds/shimmy.wav,100
Sound05=./Sound/c172sounds/c172_stallhorn_first.wav,100
Sound06=./Sound/c172sounds/prop_turn.wav,100
Sound07=./Sound/c172sounds/prop_to.wav,100
Sound08=./Sound/c172sounds/brakes1.wav,100
Sound09=./Sound/c172sounds/c172_stallhorn_high.wav,100


[LVars]
Lvar00=GH_Sound01
Lvar01=GH_Sound02
Lvar02=GH_Sound03
Lvar03=GH_Sound04
Lvar04=GH_Sound05
Lvar05=GH_Sound06
Lvar06=GH_Sound07
Lvar07=GH_Sound08
Lvar08=GH_Sound09
Lvar09=GH_Sound10

the sound play once but for only 0.01 sec... I dont know why
 
As doug said, you must then check the rest of your code, something must interupt it if it play only for 0.1 sec.

Can you send me your sound files so that I try it in my setup.
Zip the Sound folder you use that also include the INI file.

I will write the gauge myself (copy from here) and then test only this ONE particular sound (without any other coding). if it work we can test the rest of your gauge sounds and try and determine what cut it short.


Then I will try it on my side.

my email below.
-----------------
Bliksimpie at gmail dot com
 
Last edited:
Hi folk!
Can someone clarify the copyright situation? In terms, may I use dsd_xml_sound gauge in payware projects?
Thanks!

The gauge is free for use in freeware projects. It requires a license for use in commercial projects. Flip me an e-mail outlining what you are considering.

Doug
 
If this is of any help, this is a cabin safety message.
It plays two sounds. First the BAsafety, followed by mes2 which is the cabin reporting to the flightdeck. Plus a delay which feeds into the steward's light on the OH panel.
vololiberista
Code:
<Gauge Name="Safety Vid" Version="1.0">
<Image Name="SWAP.bmp"/>
<Update>
(L:Monitor_Sound, bool)
if{ (L:Sound_BAsafety,enum) ! if{ 0 (>L:Monitor_Sound, bool) 1 (>L:Sound_mes2,enum) (P:local time, seconds) 6.5 + (>L:CAB LIGHT 2,number) and }
}
</Update>

<Element>
      <Select>
         <Value>(L:safety,number)</Value>
         <Case Value="0">
            <Image Name="SWAP.bmp"/>
         </Case>
         <Case Value="1">
            <Image Name="SWAP.bmp"/>
         </Case>
      </Select>
   </Element>

   <Mouse>
<Tooltip>Cabin Safety Briefing</Tooltip>
  <Cursor Type="Hand" /> 
         <Click>1 (>L:Sound_BAsafety,enum)
1 (>L:Monitor_Sound, bool)
</Click>
   </Mouse>
</Gauge>
 
Back
Top