title: AxWindowsMediaPlayer Clip Will Sometimes Not Play
body: <p>I have a simple one-threaded windows forms .NET 4.5 app where user listens to spoken words (wav files) and then selects the correct picture that represents the word.</p>
  
  <p>The problem is that the clip will sometimes (very rarely - about 1% of the time and completelly at random) not play...</p>
  
  <p>This is the method for playing clips:</p>
  
  <pre><code>    public static void PlayWordAudio(Word word, AxWMPLib.AxWindowsMediaPlayer player)
      {
          string tempFile = Path.GetTempFileName() + ".wav";
  
          MemoryStream stream = new MemoryStream(word.Audio);
  
          using (Stream fileStream = File.OpenWrite(tempFile))
          {
              stream.WriteTo(fileStream);
          }
  
          player.URL = tempFile;
  
          File.Delete(tempFile);
      }
  </code></pre>
  
  <p>Can someone please suggest a solution to this problem? Maybe I shouldn't delete the file at the end of the method? But then temp files would pile up...</p>
  
  <p>I am on Windows 7...</p>