hedgewars/uSound.pas
changeset 14878 4e3d81af71bf
parent 14831 64f88108926b
child 14912 3a53309e684b
equal deleted inserted replaced
14877:421eed52a8e1 14878:4e3d81af71bf
   378 end;
   378 end;
   379 
   379 
   380 procedure InitSound;
   380 procedure InitSound;
   381 const channels: LongInt = 2;
   381 const channels: LongInt = 2;
   382 var success: boolean;
   382 var success: boolean;
       
   383     s: shortstring;
   383 begin
   384 begin
   384     if not (isSoundEnabled or isMusicEnabled) then
   385     if not (isSoundEnabled or isMusicEnabled) then
   385         begin
   386         begin
   386         isAudioMuted:= true;
   387         isAudioMuted:= true;
   387         cInitVolume:= 0;
   388         cInitVolume:= 0;
   410 
   411 
   411     WriteToConsole('Init SDL_mixer... ');
   412     WriteToConsole('Init SDL_mixer... ');
   412 
   413 
   413     if (Mix_Init(MIX_INIT_OGG or MIX_INIT_OPUS) and MIX_INIT_OPUS) = 0 then
   414     if (Mix_Init(MIX_INIT_OGG or MIX_INIT_OPUS) and MIX_INIT_OPUS) = 0 then
   414     begin
   415     begin
   415       WriteToConsole('Cannot init OPUS: ' + SDL_GetError());
   416       s:= SDL_GetError();
       
   417       WriteToConsole('Cannot init OPUS: ' + s);
   416 
   418 
   417       if SDLCheck(Mix_Init(MIX_INIT_OGG) <> 0, 'Mix_Init', true) then exit;
   419       if SDLCheck(Mix_Init(MIX_INIT_OGG) <> 0, 'Mix_Init', true) then exit;
   418     end;
   420     end;
   419 
   421 
   420     WriteLnToConsole(msgOK);
   422     WriteLnToConsole(msgOK);