public void run() {
        try {
            Thread.sleep((int) (fadeTimeOffset*1000.0f));
            isFading = true;
            if(fadeEndGain < fadeStartGain) {
                gameSong.startFadeOut();
            }
            int maxLoops = (int)(fadeTime*(1000.0f/(float)RATE));
            for(int i = 0; i < maxLoops; i++) {
                if(!stop) {
                    gameSong.setVolume(fadeCurrentGain);
                    fadeCurrentGain += (fadeEndGain - fadeStartGain) / (float)maxLoops;
                    Thread.sleep(RATE);
                }
            }
            if(!stop) {
                gameSong.setVolume(fadeEndGain);
            }
            isFading = false;
            if(fadeEndGain < fadeStartGain) {
                gameSong.endFadeOut();
            }
        } catch (Exception e) {
            EIError.debugMsg(e.getMessage());
        }
    }