mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-08 22:11:09 +00:00
Show the name of unsupported sound formats with OpenAL
This commit is contained in:
parent
afcada4a3b
commit
7f3be7bf14
3 changed files with 28 additions and 2 deletions
|
@ -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 ();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue