anchor.diff:    gLog.AddTime('ALC_MONO_SOURCES',NumMono);
     gLog.AddTime('ALC_STEREO_SOURCES',NumStereo);
   
  -  for I:=1 to MAX_SOUNDS do begin
  +  for I := Low(fALSounds) to High(fALSounds) do
  +  begin
       AlGenBuffers(1, @fALSounds[i].ALBuffer);
       AlGenSources(1, @fALSounds[i].ALSource);
     end;
  
positive.code: 
  
    //Find free buffer and use it
    FreeBuf := 0;
    for I := 1 to MAX_SOUNDS do
    begin
      alGetSourcei(fALSounds[i].ALSource, AL_SOURCE_STATE, @ALState);
      if ALState<>AL_PLAYING then
  
negative.code: end;
  
  
  function TKMSoundPlayer.CanAddLoopSound: Boolean;
  var
    I, Cnt: Integer;
  begin
    Result := True;
    Cnt := 0;
    for I := Low(fScriptSoundALIndex) to High(fScriptSoundALIndex) do
    begin
      if (fScriptSoundALIndex[I] <> -1) and fALSounds[fScriptSoundALIndex[I]].Looped then
        Inc(Cnt);
      if Cnt >= MAX_LOOP_SOUNDS then
        Exit(False);
    end;
  end;
  
  
  //Returns -1 if it was not possible to start play sound (f.e. sounds queue is overloaded)
  //        Script Sound Index in fScriptSoundALIndex array
  function TKMSoundPlayer.PlayScriptSound(const aFile: UnicodeString; aLoc: TKMPointF; aAttenuate: Boolean; aVolume: Single;
                                          aRadius: Single; aFadeMusic, aLooped: Boolean): Integer;
  var
    I: Integer;
  begin
    Result := -1; //Failed to play
  
    //Do not allow too many loop sounds
    if aLooped and not CanAddLoopSound then
      Exit;
  
    for I := Low(fScriptSoundALIndex) to High(fScriptSoundALIndex) do
      if fScriptSoundALIndex[I] = -1 then //Empty slot here
      begin
        //Save sound index from fALSound array
        fScriptSoundALIndex[I] := PlaySound(sfxNone, aFile, aLoc, stGame, aAttenuate, aVolume, aRadius, aFadeMusic, aLooped, True);
        if fScriptSoundALIndex[I] <> -1 then
          Result := I; //Successfully playing
        Exit;
      end;
  