anchor.diff:  
   procedure TKMScriptSoundsManager.Load(LoadStream: TKMemoryStream);
   var
  -  I: Integer;
  +  I, SoundCount: Integer;
  +  S: TKMScriptSound;
   begin
     LoadStream.CheckMarker('ScriptSoundsManager');
     LoadStream.Read(fLastScriptUID);
  -  LoadStream.Read(fCount);
  -  SetLength(fScriptSounds, fCount);
  -  for I := 0 to fCount - 1 do
  -  begin
  -    LoadStream.Read(fScriptSounds[I].ScriptUID);
  -    LoadStream.ReadA(fScriptSounds[I].SoundName);
  -    LoadStream.Read(fScriptSounds[I].Volume);
  -    LoadStream.Read(fScriptSounds[I].Radius);
  -    LoadStream.Read(fScriptSounds[I].Attenuate);
  -    LoadStream.Read(fScriptSounds[I].Loc);
  -    LoadStream.Read(fScriptSounds[I].HandIndex);
  -    fScriptSounds[I].PlayingIndex := -1; //Indicates that it is not currently playing
  -  end;
  -end;
  -
  +  LoadStream.Read(SoundCount);
  +  fScriptSounds.Clear;
  +  for I := 0 to SoundCount - 1 do
  +  begin
  +    S := TKMScriptSound.Create;
  +    LoadStream.Read(S.Looped);
  +    LoadStream.Read(S.FadeMusic);
  +    LoadStream.Read(S.ScriptUID);
  +    LoadStream.ReadA(S.SoundName);
  +    LoadStream.Read(S.AudioFormat, SizeOf(S.AudioFormat));
  +    LoadStream.Read(S.Volume);
  +    LoadStream.Read(S.Radius);
  +    LoadStream.Read(S.Attenuate);
  +    LoadStream.Read(S.Loc);
  +    LoadStream.Read(S.HandIndex);
  +    S.PlayingIndex := -1; //Indicates that it is not currently playing
  +    fScriptSounds.Add(S);
  +  end;
  +end;
  +
  +
  +{ TKMScriptSound }
  +
  +constructor TKMScriptSound.Create;
  +begin
  +  PlayingIndex := -1;
  +  Looped := False;
  +  FadeMusic := False;
  +  ScriptUID := 0;
  +  SoundName := '';
  +  AudioFormat := Low(TKMAudioFormat);
  +  Volume := 0.0;
  +  Radius := 0.0;
  +  Attenuate := False;
  +  Loc := KMPoint(0,0);
  +  HandIndex := 0;
  +end;
   
   end.
  
positive.code:     Attenuate: Boolean;
      Loc: TKMPoint;
      HandIndex: TKMHandID;
    end;
  
    TKMScriptSoundsManager = class
    private
      fListener: TKMPointF;
      fLastScriptUID: Integer; //Last Unique ID for playing sound from script
      fCount: Integer;
      fScriptSounds: array of TKMScriptSound;
      function CanPlay(aIndex: Integer): Boolean; overload;
      function CanPlay(aScriptSound: TKMScriptSound): Boolean; overload;
      function StartSound(aIndex: Integer): Integer; overload;
      function StartSound(var aScriptSound: TKMScriptSound): Integer; overload;
      procedure StopSound(aIndex: Integer);
      procedure RemoveSoundByIndex(aIndex: Integer);
      function GetCount: Integer;
    public
      constructor Create;
      destructor Destroy; override;
      property Count: Integer read GetCount;
  
      procedure Save(SaveStream: TKMemoryStream);
      procedure Load(LoadStream: TKMemoryStream);
  
      function AddSound(aHandIndex: TKMHandID; const aSoundName: AnsiString; aSoundFormat: TKMAudioFormat; aLoc: TKMPoint;
                        aAttenuate: Boolean; aVolume: Single; aRadius: Single; aFadeMusic, aLooped: Boolean): Integer;
      procedure RemoveLoopSoundByUID(aScriptIndex: Integer);
      procedure RemoveSoundByUID(aScriptUID: Integer; aLoopedOnly: Boolean = False);
      procedure UpdateListener(X,Y: Single);
  
negative.code:       end
        else
          raise Exception.Create('Unsupported sound file format: ' + FileExt);
  
        WAVDuration := round(WAVsize / WAVfreq * 1000);
        case WAVformat of
          AL_FORMAT_STEREO16: WAVDuration := WAVDuration div 4;
  