• 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.

MSFS20 Cockpit sounds

Messages
531
Country
france
Hello,
I would like to trigger cockpit sounds (alerts, altitude callouts, ...) from my JS code. I know the sound files must be packed into a Wwise package, this is what MSFS requires.
If I have the wav files, do you know how complex it is to generate a Wwise package that inlcudes them all?

Thanks,
Eric
 
The official documentation has a section on the subject:


There is also an example in the SDK, I have never tried using wwise, for me, looks a bit complex for simple implementations.
What I can say is that you can use wav files directly, calling them from Sound XML.


Hope this help.

Regards
 
Yes, SDK supports sound.cfg driven .wav files and also XML driven Wwise.
 
OK, thanks for this info.
If .wav files can be used through the sound.cfg, what is the interest of Wwise?
Sometimes I feel Asobo added complexity where it was not needed...
 
I am not an expert, but from what I have read, there are many advantages in using wwise, some examples:
if the number of sounds is large, using wavs would fill up the file directory, which is annoying.
With wavs you have very few customization options, instead with wwise there are several parameters that you can adjust, to improve the sound.
Something fundamental is that with wwise you can affect the sound to give it dimensions or locations.
I believe that Wav is applicable to simple sound situations, but engines or environment sounds, which are more complex, the potential of wwise cannot be solved with wavs.
 
Wwise is a sound engine. Any sounds it is going to use must be a .wav file using the PCM audio format. So... I do think claiming it is better than .wav files might be a bit much. Even Prepar3D has an audio engine that can do a great deal of sound manipulation using .wav files.
 
IMHO WWise is more of a hindrance than an asset for custom in-cockpit sounds, as that forces you into a build process with that unique tool each time you add/change/reprogram some minor sound on a user interaction.

A "wav" sound (in this case "cable_break.wav") can be connected to a model node ("hook_internal") triggered by an L: var ("L:B21_SOUND_CABLE_BREAK) in seconds with:

Code:
sound.xml:

...
<SimVarSounds>
    <Sound WwiseData="false" WwiseEvent="STALL_WARNING" FileName="cable_break" ViewPoint="Inside" NodeName="hook_internal"
        LocalVar="B21_SOUND_CABLE_BREAK" Continuous="false" BreakOnStop="true"/>
...

Remember to update your layout.json when you add the wav file. Top tip: systematically name your SOUND L:vars as they are going to get broadcast to every plane in your local sim.
 
A "wav" sound (in this case "cable_break.wav") can be connected to a model node ("hook_internal") triggered by an L: var ("L:B21_SOUND_CABLE_BREAK) in seconds with:

Code:
sound.xml:
...
<SimVarSounds>
    <Sound WwiseData="false" WwiseEvent="STALL_WARNING" FileName="cable_break" ViewPoint="Inside" NodeName="hook_internal"
        LocalVar="B21_SOUND_CABLE_BREAK" Continuous="false" BreakOnStop="true"/>
...

Remember to update your layout.json when you add the wav file. Top tip: systematically name your SOUND L:vars as they are going to get broadcast to every plane in your local sim.
Hi B21-soaring

How to connect the .wav file to a node?
Is it in blender?
If so, should we create some kind of animation to activate the L-type variable or the name of the node is enough to trigger the sound via the sound.xml?
Thanks

Jean
 
FYI, I also saw you can define sounds in the sound.xml file that are defined as .wav files in the sound folder, without needing to have them in the Wwise package. You just have to set the "WwiseData" to false. I saw this in the documentation but couldn't make it work yet.
 
This works for me:

<Sound WwiseData="false" WwiseEvent="custom_sound_01" FileName="sound_001" ViewPoint="Inside" Continuous="false" LocalVar="AIC_SACTION" Units="number" Panning="-9000"><Requires LocalVar="AIC_SACTION" Units="number"><Range LowerBound="1" UpperBound="1"/></Requires></Sound>

Added to PMDG 737 Sound xml.
AIC_SACTION is an Lvar defined by me and managed by a wasm module, when I set it to 1 file "sound_001.wav" is played.

Everything that this guy says is done in this way, since they have not given us an interface to use TTS from the sim :-(

 
Hi degorap,
Thanks for sharing this sound configuration. I was wondering how to play this kind of sound, now I understand how it is done through an L:var.
 
You're welcome, for more information


I am far from having a complete understanding of the functionality, surely someone more expert would do it more efficiently and with more capabilities, but using the basics it has worked for me.
As additional information, although the documentation says that the "custom_sound_N" can be up to 12, the reality is that in each entry of the xml I use "custom_sound_01" and I repeat it without problems, so I have already added more than 20 sounds to the co-pilot and I'm still adding.

D.
 
Hi degorap,

I just did a test (screenshot attached)
No sound is heard when opening the door
Where is my error(s)?
Thanks


2022-12-20_14-06-46.jpg
 
I couldn't tell you, it could be several things, at this moment 2 comes to my mind:

You have defined the Lvar as "bool" in your code and in the def of the xml you use as "Number", try to use the same definition, you can try both as bool and both as number if it doesn't work.

Another thing to consider is the WAV file type, it must have certain characteristics.

"The sound formats available to use with Wave Data are PCM *.wav at 16 bits per sample and Microsoft ADPCM *.wav compressed format."

verify that your WAV is of this type.

Regards
 
Jean_L,
You should also make sure your sound definition (shown on your screenshot) is in the right section of the sound.xml.
I think this is important. I am playing with avionic sounds and if they are not defined in the <AvionicSound> section, they don't work.

Eric
 
Absolutely, must check that the Sound definition is in this section:

<SimVarSounds>
...
line here
...
</SimVarSounds>
 
Hi Eric and degorap,

The wav file checked with Magic Audio Converter is indeed a PCM *.Wav in 16 bits.
I changed Number to Bool and the code is well placed in the SimVarsSound section.
After new compilation.....

THAT WORKS
Many thanks to you both

Jean
 
Hi,

I'm coming back to you with a new question.

I realized that if you only use a LocalVar to call a click sound, it no longer works for the other switches.
Indeed, the switch actuated first sets the variable to ON and it remains there as long as the switch is not actuated in the other direction.
What makes that the interacted then with the same variable considers that it is already on ON and does not call any sound.

Anyway, for the 4-position fuel selector, I got around the problem by setting the variable to ON for positions 0 and 2 and to OFF for positions 1 and 3.
And then we get the ON-OFF-ON-OFF sequence.

Now I'm looking for how to repeat a sound for the comm and nav frequency change knobs.
Do you have an idea for this?

Thanks

Jean
 
Back
Top