Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #72491

Automating windows media player on win7

From Deogratius Musiige <DMusiige@sennheisercommunications.com>
Subject Automating windows media player on win7
Date 2014-06-03 08:10 +0000
Newsgroups comp.lang.python
Message-ID <mailman.10605.1401784849.18130.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi guys,

I have been fighting with automating wmplayer but with no success.
It looks to me that using the .OCX would be the best option. I found the code below on the net but I cannot get it to work.
I can see from device manager that a driver is started by I get no audio out.
What am I doing wrong guys?


# this program will play MP3, WMA, MID, WAV files via the WindowsMediaPlayer

from win32com.client import Dispatch

mp = Dispatch("WMPlayer.OCX")

tune = mp.newMedia("./plays.wav")

mp.currentPlaylist.appendItem(tune)

mp.controls.play()

raw_input("Press Enter to stop playing")

mp.controls.stop()

Br
Deo

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Automating windows media player on win7 Deogratius Musiige <DMusiige@sennheisercommunications.com> - 2014-06-03 08:10 +0000

csiph-web