5

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

iPhoneProcessor
  • 4,980
  • 6
  • 27
  • 49

1 Answers1

1

For me this worked:

   OALSimpleAudio.sharedInstance().playEffect("buttonUp_1.caf")
Guru
  • 21,652
  • 10
  • 63
  • 102