diff options
author | Joerg Mueller <nexyon@gmail.com> | 2011-09-07 01:02:26 +0400 |
---|---|---|
committer | Joerg Mueller <nexyon@gmail.com> | 2011-09-07 01:02:26 +0400 |
commit | 813d09cb5904bd435a6eefa328314d3cb9076be8 (patch) | |
tree | fb483a45a72fb995bdf57e9173aa7ce09ace5a22 /source/gameengine/Converter/KX_ConvertActuators.cpp | |
parent | 53671577a4ead5e96889a5fcd5a04255f8c948de (diff) |
BGE fix: ignore sounds that cannot be opened instead of crashing. ;-)
Diffstat (limited to 'source/gameengine/Converter/KX_ConvertActuators.cpp')
-rw-r--r-- | source/gameengine/Converter/KX_ConvertActuators.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp index 8fc224fba6f..6ba178cbb2f 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.cpp +++ b/source/gameengine/Converter/KX_ConvertActuators.cpp @@ -413,14 +413,21 @@ void BL_ConvertActuators(char* maggiename, // if sound shall be 3D but isn't mono, we have to make it mono! if(is3d) { - AUD_Reference<AUD_IReader> reader = snd_sound->createReader(); - if(reader->getSpecs().channels != AUD_CHANNELS_MONO) + try { - AUD_DeviceSpecs specs; - specs.channels = AUD_CHANNELS_MONO; - specs.rate = AUD_RATE_INVALID; - specs.format = AUD_FORMAT_INVALID; - snd_sound = new AUD_ChannelMapperFactory(snd_sound, specs); + AUD_Reference<AUD_IReader> reader = snd_sound->createReader(); + if(reader->getSpecs().channels != AUD_CHANNELS_MONO) + { + AUD_DeviceSpecs specs; + specs.channels = AUD_CHANNELS_MONO; + specs.rate = AUD_RATE_INVALID; + specs.format = AUD_FORMAT_INVALID; + snd_sound = new AUD_ChannelMapperFactory(snd_sound, specs); + } + } + catch(AUD_Exception&) + { + // sound cannot be played... ignore } } } |