Sorry for the delay but I have only just now got to doing sounds. I don't know if you ever solved your issue but here is what I have learnt so far:
AnimationTriggers are a bit buggy I think. Either that or I don't understand exactly how they work. I could not get my magneto switches to work at all and my primer switch would only work on the downpress and not the release. If I use local variables in the animation it seems to work but using simulation variables (A: vars) seems to be an issue. There's something weird going on here and it doesn't make any sense. At least there is a workaround.
Here is an example of a 3 position starter switch, off, battery, starter which works well when added to the model behaviors. I'm using keyframes. 0, 10 and 20 for the positions. Two different types of sounds depending on which way the starter is turning.
Code:
<AnimationTriggers Animation="a582_Starter">
<EventTrigger Frame="1" Direction="Forward">
<SoundEvent WwiseEvent="Starter_Key_1" Action="Play"/>
</EventTrigger>
<EventTrigger Frame="11" Direction="Forward">
<SoundEvent WwiseEvent="Starter_Key_1" Action="Play"/>
</EventTrigger>
<EventTrigger Frame="19" Direction="Backward">
<SoundEvent WwiseEvent="Starter_Key_2" Action="Play"/>
</EventTrigger>
<EventTrigger Frame="9" Direction="Backward">
<SoundEvent WwiseEvent="Starter_Key_2" Action="Play"/>
</EventTrigger>
</AnimationTriggers>
This is the sound.xml code you need to add to link the wwiseevent to your soundpack:
Code:
<AnimationSounds>
<!--This sound will play every time the event "MySound" is sent through the animation-->
<Sound WwiseData="true" WwiseEvent="fuel_switch" NodeName="Cockpit_fuses" ViewPoint="Inside"/>
<Sound WwiseData="true" WwiseEvent="12v_switch" NodeName="12V power" ViewPoint="Inside"/>
<Sound WwiseData="true" WwiseEvent="Starter_Key_1" NodeName="Gauges_Starter_Base" ViewPoint="Inside"/>
<Sound WwiseData="true" WwiseEvent="Starter_Key_2" NodeName="Gauges_Starter_Base" ViewPoint="Inside"/>
</AnimationSounds>
The use of NodeName places the sound in the 3D space otherwise it defaults to 0,0,0. It can be any part in your model.
Due to the issues I was having with the magneto switches sounds I used the sound.xml exclusively. There is no sound code (AnimationTriggers) in the model behaviors for the magneto switches. I added the following code to the <SimVarSounds> section in the sound.xml
Code:
<Sound WwiseData="true" WwiseEvent="radio_beep" Continuous="false" LocalVar="ANTS_RADIO_BEEP"/>
<Sound WwiseData="true" WwiseEvent="Mag_Switch_Left" Continuous="false" NodeName="Gauges_Magnetoes" ViewPoint="Inside" SimVar="RECIP ENG LEFT MAGNETO" Units="Bool" Index="1"/>
<Sound WwiseData="true" WwiseEvent="Mag_Switch_Right" Continuous="false" NodeName="Gauges_Magnetoes" ViewPoint="Inside" SimVar="RECIP ENG RIGHT MAGNETO" Units="Bool" Index="1"/>
<Sound WwiseData="true" WwiseEvent="Push_In" Continuous="false" NodeName="Panel_Fuel_Primer_Mount" ViewPoint="Inside" SimVar="RECIP ENG PRIMER" Units="Bool" Index="1">
<Range UpperBound="0.5" />
</Sound>
<Sound WwiseData="true" WwiseEvent="Push_Out" Continuous="false" NodeName="Panel_Fuel_Primer_Mount" ViewPoint="Inside" SimVar="RECIP ENG PRIMER" Units="Bool" Index="1">
<Range LowerBound="0.5" />
</Sound>
There's a bit going on here so I will go through each line. The radio_beep is a local variable of my own making. Any time L:ANTS_RADIO_BEEP changes it will make a radio_beep. I can control the L: var however I like. Note the continuous="false" to stop the sound repeatedly playing.
The next two lines are the magneto switches. Again, any change to the magneto simvars will trigger the sound.
The last two lines are for the Primer switch. Push_in is when the user presses the key, Push_out will automatically release the key as that is how the primer simvar works, about half a second after the primer activates it releases automatically. Very important to have the continuous="false" to stop the sound repeatedly playing. As A:RECIP ENG PRIMER is only ever 1 or 0 (true or false) I set the upper and lower bounds to 0.5. Upperbound means something has to be below that upper limit to be true. Lowerbound means something has to be above that limit to be true.
As in the SDK example, Range LowerBound="10.0" UpperBound="15.0" is true when the variable is between 10 and 15.
LowerBound="60" is true when the variable is above 60.
For reference see "Sound examples" and "sound definitions" in the SDK