anchor.diff:      fFadedToPlayOther := False;
       UnfadeMusic(False);
     end;
  +end;
  +
  +
  +procedure TKMMusicLib.PauseMusic;
  +begin
  +  if not fIsMusicInitialized then Exit;
  +
  +  {$IFDEF USELIBZPLAY} ZPlayerOther.PausePlayback; {$ENDIF}
  +  {$IFDEF USEBASS} BASS_ChannelPause(fBassStream); {$ENDIF}
   end;
   
   
  
positive.code: {$ENDIF}
  begin
    if (not fIsMusicInitialized) then Exit;
    fFadeState := fsFadeOut; //Fade it out
    fFadeStarted := TimeGet;
    {$IFDEF USELIBZPLAY}
    ZPlayer.GetPosition(startTime);
    endTime.ms := startTime.ms + FADE_TIME;
    ZPlayer.GetPlayerVolume(left, right); //Start fade from the current volume
    ZPlayer.SlideVolume(tfMillisecond, startTime, left, right, tfMillisecond, endTime, 0, 0);
    {$ENDIF}
    {$IFDEF USEBASS}
    BASS_ChannelSlideAttribute(fBassStream, BASS_ATTRIB_VOL, 0, FADE_TIME);
    {$ENDIF}
  end;
  
  
  
  // aHandleCrackling flag is used to mitigate initial sound crackling
  procedure TKMMusicLib.UnfadeMusic(aHandleCrackling: Boolean);
  {$IFDEF USELIBZPLAY}
  var
    startTime, endTime: TStreamTime;
  
negative.code:   ZPlayer.ResumePlayback; //Music may have been paused due to fade out
    if aHandleCrackling then Sleep(25);
    ZPlayer.GetPosition(startTime);
    endTime.ms := startTime.ms + aFadeTime;
    ZPlayer.GetPlayerVolume(left, right); //Start fade from the current volume
    ZPlayer.SlideVolume(tfMillisecond, startTime, left, right, tfMillisecond, endTime, Round(fMusicGain * 100), Round(fMusicGain * 100));
    {$ENDIF}
    {$IFDEF USEBASS}
    BASS_ChannelPlay(fBassStream, False); //Music may have been paused due to fade out
    if aHandleCrackling then Sleep(25);
    BASS_ChannelSlideAttribute(fBassStream, BASS_ATTRIB_VOL, fMusicGain, aFadeTime);
    {$ENDIF}
  end;
  
  