Try the following:
first make sure you put self.userInteractionEnabled = YES;
affects the delegate method when clicked on the screen:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
[self runAction:[SKAction playSoundFileNamed:@"sfx.wav" waitForCompletion:NO]];
for (UITouch *touch in touches) {
CGPoint touchLocation = [touch locationInNode:self];
}
}
Where should I store the sound file in my project?
- you must put it in your document resource resource directory application.