views:

29

answers:

0

Hi

I have the following to play m background music:

NSURL *url = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/bgMusic.mp3", [[NSBundle mainBundle] resourcePath]]];

    NSError *error;
    bgMusic = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:&error];
    bgMusic.numberOfLoops = -1;
    bgMusic.volume = 0.1;

    if (bgMusic == nil)
        NSLog([error description]);
    else
        [bgMusic play];

But how I can I in any view, mute all sounds, not just this, any sound?

Thanks.