         self.initialVolume = 0.0;
         self.interval = 30;
         self.delta = 0.0;
+        self.fadeLength = 1800.0;
     }
     
     /**

import Foundation

class VolumeControl {
    /// Timer used for scheduling
    var timer: Timer;
    
    /// Initial volume when schedule started
    var initialVolume: Double;
    
    /// Time (in seconds) between volume changes
    var interval: UInt;
    
    /// Amount to change volume;
    var delta: Double;
    
    /**
     

    func startShrinkage() -> Void {
        self.timer.invalidate();
        
        self.initialVolume = Double(NSSound.systemVolume());
        
        // calculate change per interval from number of times timer is called
        self.delta = self.initialVolume / (self.fadeLength / Double(self.interval));
        
        self.timer = Timer.scheduledTimer(timeInterval: 30, target: self, selector: #selector(self.changeVolume), userInfo: nil, repeats: true);
    }
