hedgewars/uSound.pas
changeset 3825 fd6c20cd90e3
parent 3697 d5b30d6373fc
child 4357 a1fcfc341a52
equal deleted inserted replaced
3823:cca9bfb88a24 3825:fd6c20cd90e3
    75     AskForVoicepack:= @voicepacks[i]
    75     AskForVoicepack:= @voicepacks[i]
    76 end;
    76 end;
    77 
    77 
    78 procedure InitSound;
    78 procedure InitSound;
    79 var i: TSound;
    79 var i: TSound;
       
    80     channels: LongInt;
    80 begin
    81 begin
    81     if not isSoundEnabled then exit;
    82     if not isSoundEnabled then exit;
    82     WriteToConsole('Init sound...');
    83     WriteToConsole('Init sound...');
    83     isSoundEnabled:= SDL_InitSubSystem(SDL_INIT_AUDIO) >= 0;
    84     isSoundEnabled:= SDL_InitSubSystem(SDL_INIT_AUDIO) >= 0;
    84 
    85 
       
    86 {$IFDEF IPHONEOS}
       
    87     channels:= 1;
       
    88 {$ELSE}
       
    89     channels:= 2;
       
    90 {$ENDIF}
       
    91 
    85     if isSoundEnabled then
    92     if isSoundEnabled then
    86         isSoundEnabled:= Mix_OpenAudio(44100, $8010, 2, 1024) = 0;
    93         isSoundEnabled:= Mix_OpenAudio(44100, $8010, channels, 1024) = 0;
    87 
    94 
    88 {$IFDEF SDL_MIXER_NEWER}
    95 {$IFDEF SDL_MIXER_NEWER}
    89     WriteToConsole('Init SDL_mixer... ');
    96     WriteToConsole('Init SDL_mixer... ');
    90     SDLTry(Mix_Init(MIX_INIT_OGG) <> 0, true);
    97     SDLTry(Mix_Init(MIX_INIT_OGG) <> 0, true);
    91     WriteLnToConsole(msgOK);
    98     WriteLnToConsole(msgOK);