diff --git a/src/osx/core/sound.cpp b/src/osx/core/sound.cpp index 0f84638e29..120a807545 100644 --- a/src/osx/core/sound.cpp +++ b/src/osx/core/sound.cpp @@ -112,7 +112,13 @@ bool wxOSXAudioToolboxSoundData::Play(unsigned flags) CFStringNormalize(cfMutableString,kCFStringNormalizationFormD); wxCFRef url(CFURLCreateWithFileSystemPath(kCFAllocatorDefault, cfMutableString , kCFURLPOSIXPathStyle, false)); - AudioServicesCreateSystemSoundID(url, &m_soundID); + OSStatus err = AudioServicesCreateSystemSoundID(url, &m_soundID); + if ( err != 0 ) + { + wxLogError(_("Failed to load sound from \"%s\" (error %d)."), m_sndname, err); + return false; + } + AudioServicesAddSystemSoundCompletion( m_soundID, CFRunLoopGetCurrent(), NULL, wxOSXAudioToolboxSoundData::CompletionCallback, (void *) this ); bool sync = !(flags & wxSOUND_ASYNC);