diff --git a/src/sound/i_sound.cpp b/src/sound/i_sound.cpp index 97267d62c..852d50a6b 100644 --- a/src/sound/i_sound.cpp +++ b/src/sound/i_sound.cpp @@ -304,6 +304,27 @@ void I_ShutdownSound() } } +const char *GetSampleTypeName(enum SampleType type) +{ + switch(type) + { + case SampleType_UInt8: return "Unsigned 8-bit"; + case SampleType_Int16: return "Signed 16-bit"; + } + return "(invalid sample type)"; +} + +const char *GetChannelConfigName(enum ChannelConfig chan) +{ + switch(chan) + { + case ChannelConfig_Mono: return "Mono"; + case ChannelConfig_Stereo: return "Stereo"; + } + return "(invalid channel config)"; +} + + CCMD (snd_status) { GSnd->PrintStatus (); diff --git a/src/sound/i_soundinternal.h b/src/sound/i_soundinternal.h index 218c6724b..4f4c62b93 100644 --- a/src/sound/i_soundinternal.h +++ b/src/sound/i_soundinternal.h @@ -119,6 +119,9 @@ enum ChannelConfig ChannelConfig_Stereo }; +const char *GetSampleTypeName(enum SampleType type); +const char *GetChannelConfigName(enum ChannelConfig chan); + struct SoundDecoder { virtual void getInfo(int *samplerate, ChannelConfig *chans, SampleType *type) = 0; diff --git a/src/sound/oalsound.cpp b/src/sound/oalsound.cpp index 131d41e6f..24ca27aa4 100644 --- a/src/sound/oalsound.cpp +++ b/src/sound/oalsound.cpp @@ -545,7 +545,8 @@ public: if(Format == AL_NONE) { - Printf("Unsupported audio format (0x%x / 0x%x)\n", chans, type); + Printf("Unsupported audio format: %s, %s\n", GetChannelConfigName(chans), + GetSampleTypeName(type)); return false; } SampleRate = srate; @@ -1019,7 +1020,8 @@ SoundHandle OpenALSoundRenderer::LoadSound(BYTE *sfxdata, int length) if(format == AL_NONE) { - Printf("Unsupported audio format (0x%x / 0x%x)\n", chans, type); + Printf("Unsupported audio format: %s, %s\n", GetChannelConfigName(chans), + GetSampleTypeName(type)); return retval; }