anchor.diff:      fLog.AddToLog('OpenAL warning. OpenAL could not be initialized.');
       Application.MessageBox('OpenAL could not be initialized. Please refer to Readme.txt for solution','OpenAL warning', MB_OK + MB_ICONEXCLAMATION);
       fIsSoundInitialized := false;
  -    exit;
  +    Exit;
     end;
   
     //Open device
  
positive.code: 
    //If the folder exists it is likely all the sounds are there
    for U:=WARRIOR_MIN to WARRIOR_MAX do
      for S:=Low(TWarriorSpeech) to High(TWarriorSpeech) do
        for i:=0 to 255 do
          if not FileExists(WarriorSoundFile(U, S, i)) then
          begin
            fWarriorSoundCount[U,S] := i;
            break;
          end;
  
    //Scan warning messages (e.g. under attack)
    for N:=Low(TAttackNotification) to High(TAttackNotification) do
      for i:=0 to 255 do
        if not FileExists(NotificationSoundFile(N, i)) then
        begin
          fNotificationSoundCount[N] := i;
          break;
        end;
  end;
  
  
  end.
  
negative.code: 
  
  implementation
  uses KM_CommonTypes, KM_RenderAux, KM_Log;
  
  
  //Krom: I moved everything that is used internally down to implementation,
  //so these things are not visible from global scope
  const
    MAX_BUFFERS = 16; //16/24/32 looks like the limit, depends on hardware
    MAX_SOURCES = 32; //depends on hardware as well
    MAX_DISTANCE = 32; //After this distance sounds are completely mute
  
    WarriorSFXFolder: array[WARRIOR_MIN..WARRIOR_MAX] of string = (
      'MILITIA', 'AXEMAN', 'SWORDMAN', 'BOWMAN', 'CROSSBOW',
      'LANCEMAN', 'PIKEMAN', 'CAVALRY', 'KNIGHTS', 'BARBARIAN',
      'REBEL', 'ROGUE', 'WARRIOR', 'VAGABOND');
  
    WarriorSFX: array[TWarriorSpeech] of string = (
      'SELECT', 'EAT', 'LEFT', 'RIGHT', 'HALVE',
      'JOIN', 'HALT', 'SEND', 'ATTACK', 'FORMAT',
      'DEATH', 'BATTLE', 'STORM');
  
    AttackNotifications: array[TAttackNotification] of string = ('CITIZ0', 'TOWN0', 'UNITS0');
  
    CitizenSFX: array[CITIZEN_MIN..CITIZEN_MAX] of record
      WarriorVoice: TUnitType;
      SelectID, DeathID: byte;
    end = (
      (WarriorVoice: ut_Militia;      SelectID:3; DeathID:1), //ut_Serf
      (WarriorVoice: ut_AxeFighter;   SelectID:0; DeathID:0), //ut_Woodcutter
      (WarriorVoice: ut_Bowman;       SelectID:2; DeathID:1), //ut_Miner
      (WarriorVoice: ut_Swordsman;    SelectID:0; DeathID:2), //ut_AnimalBreeder
      (WarriorVoice: ut_Militia;      SelectID:1; DeathID:2), //ut_Farmer
      (WarriorVoice: ut_Arbaletman;   SelectID:1; DeathID:0), //ut_Lamberjack
      (WarriorVoice: ut_Pikeman;      SelectID:1; DeathID:0), //ut_Baker
      (WarriorVoice: ut_HorseScout;   SelectID:0; DeathID:2), //ut_Butcher
      //todo: Use vagabond voice: (WarriorVoice: ut_Horseman;     SelectID:2; DeathID:0), //ut_Fisher
      (WarriorVoice: ut_HorseScout;   SelectID:2; DeathID:0), //ut_Fisher
      (WarriorVoice: ut_Cavalry;      SelectID:1; DeathID:1), //ut_Worker
      (WarriorVoice: ut_Hallebardman; SelectID:1; DeathID:1), //ut_StoneCutter
      (WarriorVoice: ut_Cavalry;      SelectID:3; DeathID:4), //ut_Smith
      (WarriorVoice: ut_Hallebardman; SelectID:3; DeathID:2), //ut_Metallurgist
      (WarriorVoice: ut_Bowman;       SelectID:3; DeathID:0)  //ut_Recruit
      );
  
  
  { TSoundLib }    
  constructor TSoundLib.Create(aLocale:string; aVolume:single);
  var
    Context: PALCcontext;
  