I have the following code in myScene.h :
#import <AVFoundation/AVFoundation.h>
And this code in the touchBegin method:
[self runAction:[SKAction playSoundFileNamed:@"fire.m4a" waitForCompletion:NO]];
The audio file is in the main folder. When I run the app and touch the app is shut down and I get the following error:
Terminating app due to uncaught exception 'Missing Resource', reason: 'Resource fire.m4a cannont be found in the main bundle'
I thought this is the way to play audio in Sprite Kit but I must be doing something wrong..
Delete the file from your project and add it again. Remember to select
Copy items into destination group...
And select your project as a target (not test).
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