Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mstartea11

macrumors newbie
Original poster
Jan 25, 2015
1
0
I'm currently making a little game, and I am having an issue with sound.

I've tried converting the file "pew.mp3" to pew.aif and pew.caf without much luck.

I have dragged it into the "support" section of the game (the same way i've add hundreds of images) and the sound effect does not work.
Code:
  [self runAction:[SKAction playSoundFileNamed:@"pew.aif" waitForCompletion:NO]];

is what I am using. When I use the .aif or .caf the error i get is "'NSInvalidArgumentException', reason: 'Resource pew.aif cannot be found in the main bundle'"

I guess my question is do you have to use .caf or .aif? Or can you just use .mp3?

Any ideas?
 
The first step is to confirm that the file is really being added to the bundle. Make sure it's really there, in the right place, with the right name.

Confirming its presence in the Xcode project is only half an answer. If it's in the project but not in the built bundle, then that's the problem that needs solving, not the file's sound format.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.