summaryrefslogtreecommitdiff
path: root/src/sound.cpp
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2005-04-06 14:42:09 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2005-04-06 14:42:09 +0000
commitc74357ef532d9c90ec1605048b9602da78e7928c (patch)
treee1f1099c1d7afa68f917da8a9f376ed287f5c14d /src/sound.cpp
parent61db1f370d1e918ccc89bed76ccdc5af2883a774 (diff)
downloadmana-c74357ef532d9c90ec1605048b9602da78e7928c.tar.gz
mana-c74357ef532d9c90ec1605048b9602da78e7928c.tar.bz2
mana-c74357ef532d9c90ec1605048b9602da78e7928c.tar.xz
mana-c74357ef532d9c90ec1605048b9602da78e7928c.zip
Adding some debug infos to the sound engine
Diffstat (limited to 'src/sound.cpp')
-rw-r--r--src/sound.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/sound.cpp b/src/sound.cpp
index 57d93b3a..cd767ef7 100644
--- a/src/sound.cpp
+++ b/src/sound.cpp
@@ -33,8 +33,7 @@ void Sound::init(int voices, int mod_voices)
bgm = NULL;
int audio_rate = 44100;
Uint16 audio_format = AUDIO_S16; // 16-bit stereo
- //int audio_channels = 2;
- int audio_channels = 8; // Default
+ int audio_channels = 2;
int audio_buffers = 4096;
if (Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers))
@@ -47,13 +46,24 @@ void Sound::init(int voices, int mod_voices)
}
Mix_QuerySpec(&audio_rate, &audio_format, &audio_channels);
+ char *format_str="Unknown";
+ switch(audio_format) {
+ case AUDIO_U8: format_str="U8"; break;
+ case AUDIO_S8: format_str="S8"; break;
+ case AUDIO_U16LSB: format_str="U16LSB"; break;
+ case AUDIO_S16LSB: format_str="S16LSB"; break;
+ case AUDIO_U16MSB: format_str="U16MSB"; break;
+ case AUDIO_S16MSB: format_str="S16MSB"; break;
+ }
pan = 128;
items = -1;
isOk = 0;
logger.log("Sound::init() Initializing Sound");
- logger.log("Sound::init() Spec: %i %i %i", audio_rate, audio_format,
+ char driver[40];
+ logger.log("Sound::init() Driver name: %s", SDL_AudioDriverName(driver, 40));
+ logger.log("Sound::init() Spec: %i %s %i", audio_rate, format_str,
audio_channels);
}