From 83832495746f3e6031927c4815c4d23805500099 Mon Sep 17 00:00:00 2001 From: Oleg Derevenetz Date: Wed, 4 Jan 2023 23:48:17 +0000 Subject: [PATCH] Set audio frequency to 44100 on Windows (#6455) --- src/engine/audio.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/engine/audio.cpp b/src/engine/audio.cpp index 8df312b486d..c5c83db66b7 100644 --- a/src/engine/audio.cpp +++ b/src/engine/audio.cpp @@ -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 * @@ -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;