void Start()
 {
     config = AudioMufflerConfig.loadConfig();
     if (!config.EngageMuffler)
     {
         return;
     }
     GameEvents.onVesselChange.Add(VesselChange);
     GameEvents.onVesselWasModified.Add(VesselWasModified);
     AudioSource[] audioSources = FindObjectsOfType(typeof(AudioSource)) as AudioSource[];
     audioMixer = AudioMixerFacade
                  .InitializeMixer(KSP.IO.IOUtils.GetFilePathFor(typeof(Muffler), "mixer.bundle")
                                   .Replace("/", System.IO.Path.DirectorySeparatorChar.ToString()));
     StockAudio.PrepareAudioSources(audioMixer, audioSources);
     audioMixer.setInVesselCutoff(config.WallCutoff);
 }
        public static AudioMufflerConfig loadConfig()
        {
            AudioMufflerConfig config = new AudioMufflerConfig();

            string     path = KSP.IO.IOUtils.GetFilePathFor(typeof(Muffler), "muffler.cfg").Replace("/", System.IO.Path.DirectorySeparatorChar.ToString());
            ConfigNode node = ConfigNode.Load(path);

            config.debug                  = bool.Parse(node.GetValue("debug"));
            config.engageMuffler          = bool.Parse(node.GetValue("enabled"));
            config.minCacheUpdateInterval = int.Parse(node.GetValue("minCacheUpdateInterval"));
            config.wallCutoff             = float.Parse(node.GetValue("wallCutoff"));
            config.minimalCutoff          = float.Parse(node.GetValue("minimalCutoff"));
            config.helmetOutsideIVA       = bool.Parse(node.GetValue("helmetOutsideIVA"));
            config.helmetOutsideEVA       = bool.Parse(node.GetValue("helmetOutsideEVA"));
            config.helmetForUnmanned      = bool.Parse(node.GetValue("helmetOutsideEVA"));
            config.helmetInMapView        = bool.Parse(node.GetValue("helmetInMapView"));
            config.vesselInMapView        = bool.Parse(node.GetValue("vesselInMapView"));
            config.outsideInMapView       = bool.Parse(node.GetValue("outsideInMapView"));

            return(config);
        }