Procedurally generated sound in WASM

Hello, currently is possible to play a sound generated at run time in WASM?
If not, it could be a desirable feature to extend Wwise capabilities?

1 Like

You could set L:VARS in WASM to then trigger Wiise events via those variables.

Best,
Raul

So I have to use RTPC? Excuse me but this part of the documentation seems not very clear to me for my use case

From what I understand I could use custom_sound_ N WwiseEvent as described here: Wave Data Sounds Properties (flightsimulator.com)

In this case a filename must be specified in the sound.xml. So I should replace this file at runtime in order to play a runtime generated sound?

You can use also WAV files too and trigger them via an L:VAR indeed…

Best,
Raul

OK but I’m missing how to link in the WASM code the procedurally generated WAV with the L:VAR, I mean I can for example create a white noise WAV in C++ and make it save in the work folder.
But then how this new file can be triggered by the Wwise event?

You cannot create a .WAV via WASM, you would create a .WAV with the sound you need, configure your sounds.xml with relevant simvars for it… and use WASM to load the variable so the sounds play.

MSFS Sounds requires a sound.xml pointing to either a WIISE package or .WAVs files already prepared to be triggered.

See the aircraft SDK samples…to understand the sound system better.

R.

OK thank you for the explanation but I strictly need to create a WAV via WASM on the fly and play it.
Maybe it could be a topic for further MSFS sound developments?

1 Like

that’s up to Microsoft / Asobo. But quite frankly I don;t see how this could work properly with the core sounds and sound.xml , etc.

R.

OK maybe an option would be to allow WAV files in the writable work folder.

That way the sound.xml could point to a dummy .wav file in the work folder that can then be modified at runtime

Hello @MaxHype
In the MSFS SDK, there is a sample regarding the call of Wwise events through WASM and LVars. The sample is called SoundAircraft, located on the Samples\DevmodeProjects\SimObjects\Aircraft folder. It has what you need, check it out.

As Raul (@SimbolFSReborn) said, you can’t create nor embed a WAV file into a WASM, so you must either have a WAV file next to the sound.xml, or include the WAV file in the Wwise soundbank.

Do not hesitate to ask for further assistance. Good luck!
Kind regards,

Carlos Daniel González Gómez
CEO, Founder & Lead Developer
NextGen Simulations

That sounds like a really great idea indeed. Let’s hope it will be possible in later iterations of MSFS.