SKAction playSoundFileNamed ERROR

I get this error after about 80 laser shots using a controllable timer, so it fires every 0.2 seconds.

* Application termination due to the uncaught exception “Resource failed to load”, reason: “Resource squish.mp3 cannot be loaded” * First throw call stack:

Here is the code that I use to play sound and create a laser. squish.mp3 is an audio file that plays when an object is destroyed. Can anyone help? Is SKAction not very good for sound reproduction?

SKAction *sound = [SKAction playSoundFileNamed:@"lazer.mp3" waitForCompletion:NO];
[self runAction:sound];
[self removeActionForKey:@"sound"];
SKSpriteNode *laser = [SKSpriteNode spriteNodeWithImageNamed:@"fire"];
+4
source share
3 answers

, , , , . , , 200 .

+2

, , , . .

SKAction, , .

, playSoundFileNamed: , , . , , , . SKAction , .

+2

I would use a more compatible format with Apple, such as AAC ( .m4a) for a sound file. Apple is not too kind to .mp3s. However, I think the file may be a Microsoft file.wav

0
source

All Articles