Skip to content

Commit

Permalink
Set audio frequency to 44100 on Windows (#6455)
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-derevenetz authored Jan 4, 2023
1 parent 48dfaf1 commit 8383249
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/engine/audio.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************************************************************************
* fheroes2: https://github.com/ihhub/fheroes2 *
* Copyright (C) 2019 - 2022 *
* Copyright (C) 2019 - 2023 *
* *
* Free Heroes2 Engine: http://sourceforge.net/projects/fheroes2 *
* Copyright (C) 2008 by Andrey Afletdinov <[email protected]> *
Expand Down Expand Up @@ -58,12 +58,17 @@ namespace
Spec()
: SDL_AudioSpec()
{
#if defined( _WIN32 )
// Value 22050 causes audio distortion on Windows
freq = 44100;
#else
freq = 22050;
#endif
format = AUDIO_S16;
channels = 2; // Support stereo audio.
silence = 0;
#if defined( ANDROID )
// TODO: a value greater than 1024 causes audio distortion on Android
// Value greater than 1024 causes audio distortion on Android
samples = 1024;
#else
samples = 2048;
Expand Down

0 comments on commit 8383249

Please sign in to comment.