SoundAircraft

The SoundAircraft sample includes a minimal set of files to set up an aircraft to play sound effects based on user interaction. The sample itself is based on the GaugeAircraft and the code is based on that which is described in the section on Sounds. The most important part of this project is the Visual Studio solution which is included in the Sources folder of the project. It's this that will be generating the WASM module for the gauges that will play the sound:

The SoundAircraft Visual Studio Solution

 

This sample can be built and added to Microsoft Flight Simulator (this process is explained further down this page) so you can test the final results within the simulation, and it's simplicity makes it an ideal study subject for those of you just getting started creating add-on content.

 

You can expand the link below to see the SoundAircraft file and folder structure:

File OverviewFile Overview

+ SoundAircraft
|---+ PackageDefinitions
|   |---+ mycompany-aircraft-wasm-sound
|   |   |---+ ContentInfo
|   |   |   |---- Thumbnail.jpg
|   |   |---- Business.json
|   |---- mycompany-aircraft-wasm-sound.xml
|---+ PackageSources
|   |---+ Data
|   |   |---+ images
|   |   |   |---- image1.jpg
|   |   |   |---- ...
|   |   |   |---- image12.jpg
|   |   |---- entypo.ttf
|   |   |---- images.txt
|   |   |---- LICENSE_OFL.txt
|   |   |---- NotoEmoji-Regular.ttf
|   |   |---- Roboto-Bold.ttf
|   |   |---- Roboto-Light.ttf
|   |   |---- Roboto-Regular.ttf
|   |   |---- screenshot-01.png
|   |   |---- screenshot-02.png
|   |---+ SimObjects
|       |---+ Airplanes
|           |---+ MyCompany_Sound_Aircraft
|               |---+ model
|               |   |---- model.cfg
|               |   |---- GaugeAircraft.xml
|               |   |---- GaugeAircraft_Interior.xml
|               |   |---- GaugeAircraft_Interior_LOD00.bin
|               |   |---- GaugeAircraft_Interior_LOD00.gltf
|               |   |---- ...
|               |   |---- GaugeAircraft_Interior_LOD04.bin
|               |   |---- GaugeAircraft_Interior_LOD04.gltf
|               |   |---- GaugeAircraft_LOD00.bin
|               |   |---- GaugeAircraft_LOD00.gltf
|               |   |---- ...
|               |   |---- GaugeAircraft_LOD04.bin
|               |   |---- GaugeAircraft_LOD04.gltf
|               |---+ model.01
|               |   |---- model.cfg
|               |---+ model.02
|               |   |---- model.cfg
|               |---+ panel
|               |   |---- panel.cfg
|               |   |---- SoundAircraft.wasm
|               |---+ sound
|               |   |---- MyCompany_Gauge_Aircraft.PC.PCK
|               |   |---- sound.xml
|               |---+ soundAI
|               |   |---- MyCompany_Gauge_Aircraft_AI.PC.PCK
|               |   |---- soundAI.xml
|               |---+ texture
|               |   |---- < various PNG files >
|               |   |---- texture.cfg
|               |---+ texture.01
|               |   |---- GaugeAircraft_FUSELAGE_albd_000.png
|               |   |---- GaugeAircraft_WINGS_albd_000.png
|               |   |---- texture.cfg
|               |---+ texture.02
|               |   |---- GaugeAircraft_FUSELAGE_albd_000.png
|               |   |---- GaugeAircraft_WINGS_albd_000.png
|               |   |---- texture.cfg
|               |   |---- thumbnail.jpg
|               |---+ texture.base
|               |   |---- < various PNG files >
|               |---- ai.cfg
|               |---- aircraft.cfg
|               |---- Approach.flt
|               |---- apron.flt
|               |---- cameras.cfg
|               |---- Climb.flt
|               |---- cockpit.cfg
|               |---- Cruise.flt
|               |---- engines.cfg
|               |---- Final.flt
|               |---- flight_model.cfg
|               |---- gameplay.cfg
|               |---- hangar.flt
|               |---- runway.flt
|               |---- systems.cfg
|               |---- taxi.flt
|---+ Sources
|   |---+ Code
|       |---+ SoundAircraft
|           |---+ .vs
|           |   |---+ SoundAircraft
|           |       |---+ v16
|           |       |   |---+ ipch
|           |       |---- .suo
|           |       |---- Browse.VC.db
|           |---- Sample2.cpp
|           |---- Sample3.cpp
|           |---- Sample3.h
|           |---- SoundAircraft.cpp
|           |---- SoundAircraft.h
|           |---- SoundAircraft.sln
|           |---- SoundAircraft.vcxproj
|           |---- SoundAircraft.vcxproj.filters
|           |---- SoundAircraft.vcxproj.user
|           |---- SoundEnum.h
|           |---- SoundMgr.cpp
|           |---- SoundMgr.h
|---- SoundAircraft.xml

 

 

Loading and building the project

In order to load and build the project in Microsoft Flight Simulator, you must have previously enabled Developer Mode (see here for more information). Once enabled, simply follow these steps:

 

  • Use the Open project... command from the File menu before starting a flight (from the Main Menu in the simulation).

Developer Mode Open Project

 

  • Select the file SoundAircraft.xml from the SoundAircraft sample project.

SoundAircraft Project Directory

 

  • The Project Editor should open automatically and show you the project mycompany-aircraft-wasm-sound (if the Project Editor doesn't open, then you can open it from the Developer Mode Tools menu)

The SoundAircraft Sample Open In The Project Editor

 

  • Clicking on the project in the Project Editor will open the Inspector Window, and here you need to click the Build Package button (if the Inspector Window does not open automatically, go to the View menu in the Project Editor and open it from there).

The Project Inspector Window

 

  • This will build a package from the files specified in your project. This package will be named mycompany-aircraft-wasm-sound and will be output in the Packages folder created in the same directory as SoundAircraft.xml:

New Package Location

 

  • Building the package will also install it into Microsoft Flight Simulator and so you can now proceed to the aircraft selection screen and select your newly added plane:The SoundAircraft Example In The Simulation

 

  • You should then start a flight using the newly added aircraft, and once in the flight you will be presented with 3 "glass cockpit" screens which can be interacted with. The first will do nothing (it is provided as a "template") and the other two will play sound effects when clicked. You can stop the sound on the thrird screen by clicking it again:
    SoundAircraft Sound Buttons In The Aircraft