title: Automating windows media player
body: <p>Any ideas about controling windows media player in Python? I found the following code on the net which runs fine but no audio is played. am using win7 64 bit machine</p>
  
  <pre><code># this program will play MP3, WMA, MID, WAV files via the WindowsMediaPlayer
  from win32com.client import Dispatch
  mp = Dispatch("WMPlayer.OCX")
  #tune = mp.newMedia("./SleepAway.mp3")
  tune = mp.newMedia("./plays.wav")
  mp.currentPlaylist.appendItem(tune)
  mp.controls.play()
  raw_input("Press Enter to stop playing")
  mp.controls.stop()
  </code></pre>