Archived

This topic is now archived and is closed to further replies.

rasmib

how to play a sound at end of one another using dsd_xml_so...

Recommended Posts

Hi,if your XML gauge contains : 1 (>L:sound1, number) 1 (>L:sound2, number) 1 (>L:sound3, number)the 3 sounds 1, 2 and 3 are played all togetherIs it possible to play sound2 when sound1 is finished, then to play sound3 when sound2 is finished, ... (is it possible to chain the sounds ?)RegardsRAS-MIB the VTH=HUD programmer (www.rasasso.org)

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Recall that the sound gauge will reset the control variable to 0 once the sound finishes playing. You will need to trap this change (from 1 to 0) and trigger the next sound once it happens.Doug

Share this post


Link to post
Share on other sites

Thanks a lot DougI will try to catch the control variable ...Today I don't know I can do that ... may be tomorrow morningRAS-MIB VTH=HUD programmer (www.rasasso.org)

Share this post


Link to post
Share on other sites

I have similar problem with "70 knots","80 knots","V1",:Rotate","V2" sounds: (A:Eng1 N2 RPM, percent) 60 > if{ (A:AUTOPILOT THROTTLE ARM, bool) 1 == (A:Ground Velocity, knot) 70 > && if{ 1 (>L:sound_70, enum) 2 (>A:AUTOPILOT THROTTLE ARM, bool) } (A:AUTOPILOT THROTTLE ARM, bool) 2 == (A:Ground Velocity, knot) 80 > && if{ 1 (>L:sound_80, enum) 3 (>A:AUTOPILOT THROTTLE ARM, bool) } (A:AUTOPILOT THROTTLE ARM, bool) 3 == (A:Ground Velocity, knot) 115 > && if{ 1 (>L:sound_V1, enum) 4 (>A:AUTOPILOT THROTTLE ARM, bool) } (A:AUTOPILOT THROTTLE ARM, bool) 4 == (A:Ground Velocity, knot) 125 > && if{ 1 (>L:sound_Rotate, enum) 5 (>A:AUTOPILOT THROTTLE ARM, bool) } (A:AUTOPILOT THROTTLE ARM, bool) 5 == (A:Ground Velocity, knot) 140 > && if{ 1 (>L:sound_V2, enum) 6 (>A:AUTOPILOT THROTTLE ARM, bool) } } At speed 70 knots "70 knots" sound appears and begin repeating without end.Does not have next sounds.How is possible it to solve it?wojtekEPKK

Share this post


Link to post
Share on other sites

There is so much wrong in that XML that I honestly don't even know where to begin...First, you can NOT set any A:vars... Those are "read only"...Second, a "bool" has only two possible values: zero or oneMaybe in the morning after I've had some coffee I'll take a crack at reformatting that into something resembling valid syntax... ;)

Share this post


Link to post
Share on other sites

>There is so much wrong in that XML that I honestly don't even>know where to begin...>>First, you can NOT set any A:vars... Those are "read>only"...>>Second, a "bool" has only two possible values: zero or one>>Maybe in the morning after I've had some coffee I'll take a>crack at reformatting that into something resembling valid>syntax... ;)Thanks Bill,I tested to remake it on base of EMB170 panel by Uwe Ingber,Hermann Lehmann and Stephan Haering and accommodate for default FSX B738 panel.I work in order to fix considerably this panel.In EMB panel, in section Autopilot it looks so(and works):(A:Eng1 N2 RPM, percent) 60 > if{ (L:Start, number) 1 == (A:Ground Velocity, knot) 70 > && if{ 1 (>L:sound_70, enum) 2 (>L:Start, number) } (L:Start, number) 2 == (A:Ground Velocity, knot) 80 > && if{ 1 (>L:sound_80, enum) 3 (>L:Start, number) } (L:Start, number) 3 == (A:Ground Velocity, knot) 115 > && if{ 1 (>L:sound_V1, enum) 4 (>L:Start, number) } (L:Start, number) 4 == (A:Ground Velocity, knot) 125 > && if{ 1 (>L:sound_Rotate, enum) 5 (>L:Start, number) } (L:Start, number) 5 == (A:Ground Velocity, knot) 140 > && if{ 1 (>L:sound_V2, enum) 6 (>L:Start, number) } } But it does not works in B738.For example callout.xml from this panel works.I will be thankful for assistance.regards,wojtek bobrowskiwbober@interia.pl

Share this post


Link to post
Share on other sites

Since 3 days I cannot heard a second sound at end of the first oneMy gauge contains (L:Say,number) 1 == if{ 1 (>L:MB_sound1,number) 2 (>L:Say,number) } els{ (L:Say,number) 2 == (L:MB_sound1,number) 0 == && if{ 1 (>L:MB_sound2,number) 0 (L:Say,number) } } 1 (L:Say,number)I may heard MB_sound1, L:Say goes from 0 to 2, L:MB_sound1 moves back to 0 when MB_sound1 is finished but L:Say stay to 2 and MB_sound2 does not playThe content of "els{" does not actI obtain the same if I replace >Element> by >Update>What is wrong ?rasmib VTH=HUD programmer (www.rasasoo.org)

Share this post


Link to post
Share on other sites

Finally I got it I may heard sound2 when sound1 is just finishedMy error is the one of a real beginner whaoooo !.....Number is a number ... with a lot of decimals (float or double)And the equality of 2 float or double numbers is not so easy ...I have replace "number" by "enum" (means integer) and it works .... Great!... My working gauge is (L:Say,enum) 1 == if{ 1 (>L:MB_sound1,enum) 2 (>L:Say,enum) }(L:Say,enum) 2 == (L:MB_sound1,enum) 0 == && if{1 (>L:MB_sound2,enum) 3 (L:Say,enum) }(L:Say,enum) 3 == (L:MB_sound2,enum) 0 == && if{0 (L:Say,enum) }1 (L:Say,number)Any time I hit "I" (Smoke key) I heard sound1 then sound2 rasmib the VTH=HUD programmer (wwww.rasasso.org)

Share this post


Link to post
Share on other sites

Hi rasmib,Sorry to disappoint you :-), but using "number" or "enum" shouldn't make any difference..... I don't know what your code should do exactly, but code like3 (L:Say,enum) (multiple occurances) is meaningless.3 (>L:Say,enum) would be :-) As a sidenote:Is this for FS9 or FSX ???Because if it is for FSX, be aware that OnEvent trapping only works in the view that you have defined the gauge in.Iow: if you have defined the gauge that contains the OnEvent code in a VC section of the panel.cfg, it only works if you are in VC view.In other views (2D, Spot, etc) the code won't work !Regards, Rob

Share this post


Link to post
Share on other sites

Hi RobSorry for mistyping the line 9 is "3 (>L:Say, enum)" of courseand there are some others as > which have to be

Share this post


Link to post
Share on other sites

>I maintain my comment : XML evaluates number as double and not>integerActually, all L:var,type are FLOAT64...Also, instead of using as your trigger, why not simply use the A:SMOKE ENABLE,bool variable? That's what it's for...(A:SMOKE ENABLE,bool) if{ do your thing here }

Share this post


Link to post
Share on other sites

>I am aware that On Event is working only if the gauge is>visible.>>My gauge is for FS9 (may be later for FSX)>>I maintain my comment : XML evaluates number as double and not>integer>Hi,Just a bit of clarification:FS9 = only needs the gauge to be visible for initializing; once this happens, it will work no matter it is being shown or not.XML "number" and "enum" both return the type of number that was originally saved, despite it's internal format (which as Bill stated, it's always a defined custom float called FLOAT64); so in your example "number" and "enum" should work the same. And this is a fact, not a comment :-) Therefore, the problem was maybe a typo somewhere in the code. However, if you still have doubts, please test it again and if it really behaves as you stated, maybe we are using a different version of dsd_xml_sound3 gauge...which would need some comment by Doug.Tom

Share this post


Link to post
Share on other sites

Hi Bill,""Also, instead of using as your trigger, why not simply use the A:SMOKE ENABLE,bool variable? That's what it's for...""Just for completeness sake :-) :I can think of two reasons for using the OnEvent trapping instead of reading the corresponding variable.(I admit: both probably don't apply in this case).1. If you want to count the events, especially at very low framerates.Like: using a repeating keystroke (keeping a keyboard key depressed).When reading the variable state, you might miss a state change due to the delay of FS-internal copying of variables to their XML-equivalents.When using OnEvent, you never miss one.2. Events in FS will only result in the corresponding variable change, if that function is enabled in FS.Like: a Smokesystem toggle event only results in a SmokeEnable variable change, if the SMokesystem is enabled in the FDE; if not, the Smoke Enable variable always remains "FALSE".While in that case, the Smoke toggle event can still be trapped with OnEvent.Best regards, Rob

Share this post


Link to post
Share on other sites

Thanks, Rob. I actually hadn't considered #2, but that makes perfect sense.

Share this post


Link to post
Share on other sites