title: Cannot use mic when using page 2nd time
body: <p>In one of my pages in my app, I record via microphone.
  As long as I stay on that page, I can stop and re-record.</p>
  
  <p>But when I navigate out of the page and return, and press record, the mic won't catch anything. The result is a mute sound.</p>
  
  <p>Here is the constructor</p>
  
  <pre><code>private byte[] _buffer;
  private int _passedSecs = 0;
  
  private const string RECORDFILE = "newrecording.wav";
  
  private Microphone _mic = Microphone.Default;
  private MemoryStream _stream = new MemoryStream();
  private DispatcherTimer _framework;
  
  public MyPage()
  {
      InitializeComponent();
  
      _framework = new DispatcherTimer();
      _framework.Interval = TimeSpan.FromMilliseconds(33);
      _framework.Tick += _framework_Tick;
  
      _mic.BufferReady += _mic_BufferReady;
  }
  
  private void _mic_BufferReady(object sender, EventArgs e)
  {
      _mic.GetData(_buffer);
      _stream.Write(_buffer, 0, _buffer.Length);
  
      var isoStore = IsolatedStorageFile.GetUserStoreForApplication();
      var targetFile = isoStore.CreateFile(RECORDFILE);
  
      WavHeaderWriter.WriteHeader(targetFile, (int)_stream.Length, 1, _mic.SampleRate);
      var dataBuffer = _stream.GetBuffer();
  
      targetFile.Write(dataBuffer, 0, (int)_stream.Length);
      targetFile.Flush();
      targetFile.Close();
  }
  </code></pre>
  
  <p>Here I record</p>
  
  <pre><code>private async void startRecording()
  {
      _framework.Start();
  
      _mic.BufferDuration = TimeSpan.FromMilliseconds(500);
      _buffer = new byte[_mic.GetSampleSizeInBytes(_mic.BufferDuration)];
  
      _stream.SetLength(0);
      _mic.Start();
  }
  </code></pre>
  
  <p>and here I stop</p>
  
  <pre><code>private void stopRecording()
  {
      var isoStore = System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForApplication();
      IsolatedStorageFileStream _data = isoStore.OpenFile(RECORDFILE, FileMode.Open);
  
      SoundEffect sound = SoundEffect.FromStream(_data);
      _data.Close();
      sound.Play();
  
      _mic.Stop();
      _framework.Stop();
      isoStore.Dispose();
  }
  </code></pre>