diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-04-21 03:26:29 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-04-21 03:26:29 +0300 |
commit | d83a092ae6271c78a66e1ef3de6e6f6eb40a566e (patch) | |
tree | 454a8f6abc314ceb717b73fd5ee676efa9768c4c /src/sound.cpp | |
parent | 188bfbdc024afe71be191d17a12bf5bf12077065 (diff) | |
download | plus-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.cpp | 17 |
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", |