summaryrefslogtreecommitdiff
path: root/src/sound.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-04-21 03:26:29 +0300
committerAndrei Karas <akaras@inbox.ru>2012-04-21 03:26:29 +0300
commitd83a092ae6271c78a66e1ef3de6e6f6eb40a566e (patch)
tree454a8f6abc314ceb717b73fd5ee676efa9768c4c /src/sound.cpp
parent188bfbdc024afe71be191d17a12bf5bf12077065 (diff)
downloadplus-d83a092ae6271c78a66e1ef3de6e6f6eb40a566e.tar.gz
plus-d83a092ae6271c78a66e1ef3de6e6f6eb40a566e.tar.bz2
plus-d83a092ae6271c78a66e1ef3de6e6f6eb40a566e.tar.xz
plus-d83a092ae6271c78a66e1ef3de6e6f6eb40a566e.zip
Add audio frequency and audio channels settings.
Diffstat (limited to 'src/sound.cpp')
-rw-r--r--src/sound.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/sound.cpp b/src/sound.cpp
index 5b7f1201d..bc3953127 100644
--- a/src/sound.cpp
+++ b/src/sound.cpp
@@ -110,9 +110,22 @@ void Sound::init()
}
const size_t audioBuffer = 4096;
+ int channels = config.getIntValue("audioChannels");
+ switch (channels)
+ {
+ case 3:
+ channels = 4;
+ break;
+ case 4:
+ channels = 6;
+ break;
+ default:
+ break;
+ }
+
+ const int res = Mix_OpenAudio(config.getIntValue("audioFrequency"),
+ MIX_DEFAULT_FORMAT, channels, audioBuffer);
- const int res = Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT,
- MIX_DEFAULT_CHANNELS, audioBuffer);
if (res < 0)
{
logger->log("Sound::init Could not initialize audio: %s",