title: How to mute audio in AVAudioPlayer?
body: <p>I have created <code>AVAudioPlayer</code>, Now I want to mute it when user click button.</p>
  
  <p>Here what I have tried :</p>
  
  <pre><code>player.volume = 1.0  //when first time i initiate my player
  
  
  - (IBAction)speakerOnOff:(id)sender {
      if (player.volume == 1.0) {
  
          [player setVolume: 0.0];
  
          NSLog(@"1volume is:%f",player.volume);
      }else if (player.volume == 0.0) {
  
          [player setVolume: 1.0];
  
          NSLog(@"2volume is:%f",player.volume);
      }
  }
  </code></pre>