Cocos2d-Swift: sound is broken

I used the code below to play sound in Cocos2d-Swift, it crashed.

OALSimpleAudio.sharedInstanceWithSources(32).playEffect("buttonUp_1.caf") 

How to resolve a crash in fast code (not ObjC)?

or

Is there any other way to play sound in cocos2d-swift using the SimpleAudio mechanism?

Crash Log:

OAL error: - [OALSimpleAudio initWithSources:] :: Failed to create an OpenAL device fatal error: nil unexpectedly found while deploying an optional value

+5
source share
1 answer

For me it worked:

  OALSimpleAudio.sharedInstance().playEffect("buttonUp_1.caf") 
+1
source

All Articles