It has been a while, but here is the foundation of what you can do using AVAudio. In this example, I will use background music, but this can be done in any way. You can subclass it in SKSpriteNode to have your own sound, which can be paused by itself or by others.
//Add this to your imports: #import <AVFoundation/AVFoundation.h>; //Add the following variable in your interface. AVAudioPlayer *player; // Put this in an init or something of the like. NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"musicFileSound" ofType:@"wav"]]; _player = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:nil];
Then, to start using [_player play];
Use [_player pause] to pause.
And [_player stop]
Here is the documentation for him, there are some interesting things you can do with him.
Keely source share