title: MonoTouch: Playing sound
body: <p>I am trying to play a short sound when user taps on the specific button. But the problem is that I always receive <strong>Object reference not set to an instance object</strong>. means Null!</p>
  
  <p>I first tried MonoTouch.AudioToolBox.SystemSound.</p>
  
  <pre><code>MonoTouch.AudioToolbox.AudioSession.Initialize();   
  MonoTouch.AudioToolbox.AudioSession.Category = MonoTouch.AudioToolbox.AudioSessionCategory.MediaPlayback;   
  MonoTouch.AudioToolbox.AudioSession.SetActive(true);   
  
  var t = MonoTouch.AudioToolbox.SystemSound.FromFile("click.mp3");
  t.PlaySystemSound();
  </code></pre>
  
  <p>Let me notice that "click.mp3" is in my root solution folder and it is flagged as Content.
  The other approach is <code>MonoTouch.AVFoundation.AVAudioPlayer</code>.</p>
  
  <pre><code>var url = NSUrl.FromFilename("click.mp3");
  AVAudioPlayer player = AVAudioPlayer.FromUrl(url);
  player.FinishedPlaying += (sender, e) =&gt; { player.Dispose(); };
  player.Play();
  </code></pre>
  
  <p>But same error. I googled it and I see that many people has this problem. We need to know whether it is a bug or not. </p>