I have a problem where I have sound in Menu > Level one. However when I exit Level one and go back to menu the sound won't stop!
What code do I need to terminate the sound?
This is the code I'm using:
- (IBAction) playsound {
NSString *path = [[NSBundle mainBundle] pathForResource:@"imsound" ofType:@"wav"];
AVAudioPlayer* myAudio=[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
myAudio.delegate = self;
myAudio.volume = 1.0;
myAudio.numberOfLoops = -1;
[myAudio play];
}