I used below code to play sound in Cocos2d-Swift, its crashed.
OALSimpleAudio.sharedInstanceWithSources(32).playEffect("buttonUp_1.caf")
How to resolve crash in swift code(not ObjC) ?
Or
Is there any other way to play sound in cocos2d-swift using SimpleAudio engine ?
Crash LOG:
OAL Error: -[OALSimpleAudio initWithSources:]: : Could not create OpenAL device fatal error: unexpectedly found nil while unwrapping an Optional value
For me this worked:
OALSimpleAudio.sharedInstance().playEffect("buttonUp_1.caf")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With