Nasal scripting language
Many applications today support scripting as a means of "gluing" the application together and enabling users to extend functionality of the application. For example, the 3d modeling application Blender implements most of its import and export filters as user contributed Python scripts, which are automatically integrated into the menu system. Many games are also integrating a scripting language to make it easier for modders to add features.
FlightGear has a scripting language called NASAL. You can find out more about it at the NASAL website.
Elements of the graphical user interface, aircraft instruments and performance can be scripted.
How to play sounds using NASAL script?
The same way one would do animations using Nasal;
Adjust properties in Nasal (they may be "private" properties in your own subtree of the property list, say /tmp/<aircraft>) and let the sound configuration file act on those properties. (from flightgear-devel)