Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.042 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'debug': 0.07; 'granted,': 0.07; 'juni': 0.09; 'tune': 0.09; 'url:github': 0.09; 'runs': 0.10; 'python': 0.11; 'project,': 0.12; 'assume': 0.14; 'windows': 0.15; "(it's": 0.16; 'chris,': 0.16; 'guys,': 0.16; 'guys?': 0.16; 'keys.': 0.16; 'received:10.43.68.240': 0.16; 'skip:[ 50': 0.16; 'subject:media': 0.16; 'subject:windows': 0.16; 'win7': 0.16; 'wrote:': 0.18; 'file,': 0.19; 'message-----': 0.19; 'import': 0.22; 'coding': 0.22; 'to:name:python-list@python.org': 0.22; 'driver': 0.24; 'header:Received:8': 0.24; 'looks': 0.24; '>': 0.26; 'player': 0.26; 'post': 0.26; 'header:In-Reply-To:1': 0.27; 'to:2**1': 0.27; 'chris': 0.29; 'ideal': 0.29; 'received:216.32': 0.30; 'received:bigfish.com': 0.30; "i'm": 0.30; 'url:mailman': 0.30; 'work.': 0.31; 'code': 0.31; 'fighting': 0.31; 'invoke': 0.31; 'option.': 0.31; 'terminate': 0.31; 'there.': 0.32; 'skip:m 30': 0.32; 'text': 0.33; 'url:python': 0.33; 'plain': 0.33; 'sources': 0.33; 'device': 0.34; 'screen': 0.34; 'skip:d 20': 0.34; 'operations': 0.35; 'test': 0.35; 'but': 0.35; 'there': 0.35; 'url:rec-html40': 0.35; 'received:10.43': 0.36; 'url:listinfo': 0.36; 'doing': 0.36; 'next': 0.36; 'charset:us- ascii': 0.36; 'similar': 0.36; 'url:org': 0.36; 'wrong': 0.37; 'url:microsoft': 0.37; 'email addr:python.org': 0.37; 'project': 0.37; 'received:10': 0.37; 'manager': 0.38; 'audio': 0.38; 'driving': 0.38; 'process,': 0.38; 'url:office': 0.38; 'to:addr :python-list': 0.38; 'files': 0.38; 'list,': 0.38; 'skip:- 10': 0.38; 'url:schemas': 0.38; 'pm,': 0.38; 'track': 0.38; 'url:omml': 0.39; 'url:2004': 0.39; 'anything': 0.39; 'does': 0.39; 'subject:': 0.39; 'success.': 0.39; 'sure': 0.39; 'url:12': 0.39; 'to:addr:python.org': 0.39; 'url:mail': 0.40; 'easy': 0.60; 'commands': 0.60; 'manually': 0.60; 'free': 0.61; 'full': 0.61; 'simply': 0.61; 'first': 0.61; 'here:': 0.62; 'back': 0.62; 're:': 0.63; 'story': 0.63; 'email name:python-list': 0.65; 'laptop': 0.65; 'movie': 0.65; 'to:addr:gmail.com': 0.65; 'media': 0.66; 'watching': 0.68; 'fact,': 0.69; 'music': 0.75; 'borrow': 0.84; 'lan.': 0.84; 'subject:player': 0.84; 'toy': 0.84; 'worth,': 0.84; 'room,': 0.93 X-Forefront-Antispam-Report: CIP:185.34.132.53; KIP:(null); UIP:(null); IPV:NLI; H:mail.demant.com; RD:mail1.demant.com; EFVD:NLI X-SpamScore: 13 X-BigFish: VPS13(zz98dI9371Ic85fh1454I542I1432Izz1f42h2148h1ee6h1de0h1fdah2073h2146h1202h1e76h2189h1d1ah1d2ah21bch1fc6h208ch1f8fizz1d7338h1de098h1df219h17326ah8275bh8275dh18c673h1de097h186068hz30ih109h2a8h839hd25hf0ah1288h12a5h12bdh137ah1441h14ddh1504h1537h153bh15d0h162dh1631h1758h18e1h1946h19b5h1b0ah1bceh224fh1cb5h1d0ch1d2eh1d3fh1dfeh1dffh1e1dh1fe8h1ff5h20f0h2152h2216h22d0h2336h2438h2461h2487h24d7h2516h2545h255eh25f6h2605h268bh26d3h27e2h28a1h1307i) Received-SPF: fail (mail137-ch1: domain of sennheisercommunications.com does not designate 185.34.132.53 as permitted sender) client-ip=185.34.132.53; envelope-from=DMusiige@sennheisercommunications.com; helo=mail.demant.com ; l.demant.com ; From: Deogratius Musiige To: Chris Angelico , "python-list@python.org" Subject: RE: Automating windows media player on win7 Thread-Topic: Automating windows media player on win7 Thread-Index: Ac9/Ao92/LcZpfCnSxeQrPxiZS+XUP//7ROA///TLzA= Date: Tue, 3 Jun 2014 09:42:59 +0000 References: In-Reply-To: Accept-Language: da-DK, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.100.3.117] Content-Type: multipart/alternative; boundary="_000_A804AEE67207BF42BAF8CEC79839C8D613BF4D23kbnmxexc11Deman_" MIME-Version: 1.0 X-OriginatorOrg: sennheisercommunications.com X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 436 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1401791313 news.xs4all.nl 2885 [2001:888:2000:d::a6]:58263 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:72501 --_000_A804AEE67207BF42BAF8CEC79839C8D613BF4D23kbnmxexc11Deman_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Chris, I want to have wmplayer as part of my automitized test for a headset via th= e USB HID. I want to be able to execute some of the following operations in my python = script: 1. Play 2. Get playing track 3. Next 4. Get active device 5. ... I am not sure if you are able to do this with your project Best regards / Med venlig hilsen Deo -----Original Message----- From: Python-list [mailto:python-list-bounces+demu=3Dsenncom.com@python.org= ] On Behalf Of Chris Angelico Sent: 3. juni 2014 10:58 Cc: python-list@python.org Subject: Re: Automating windows media player on win7 On Tue, Jun 3, 2014 at 6:10 PM, Deogratius Musiige > wrote: > 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 =3D Dispatch("WMPlayer.OCX") > > tune =3D mp.newMedia("./plays.wav") > > mp.currentPlaylist.appendItem(tune) > > mp.controls.play() > > raw_input("Press Enter to stop playing") > > mp.controls.stop() > > > > Br > > Deo First suggestion: post plain text to this list, not HTML. You don't need it= to look like the above. :) Secondly: Is there a particular reason that you need to be automating Windo= ws Media Player specifically? I have a similar project which works by sendi= ng keystrokes, which means it works with anything that reacts to keys; main= ly, I use it with VLC. It can invoke a movie or audio file, can terminate t= he process, and can send a variety of commands via keys. It's designed to b= e used on a (trusted) LAN. Code is here: https://github.com/Rosuav/Yosemite Once something's invoked by the Yosemite project, it simply runs as normal = inside VLC. Easy to debug audio problems, because they're managed the exact= same way. Granted, this does assume that it's given full control of the sc= reen (it's designed to manage full-screen video playback; in fact, my sibli= ngs are right now watching Toy Story 3 in the other room, using an old lapt= op driving a TV via S-Video, all managed via the above project), so it may = not be ideal for background music on a computer you use for other things; b= ut feel free to borrow ideas and/or code from there. (And for what it's wor= th, I use this as one of my sources of BGM when I'm coding - just let it in= voke the file, then manually flip focus back to what I'm doing.) ChrisA -- https://mail.python.org/mailman/listinfo/python-list --_000_A804AEE67207BF42BAF8CEC79839C8D613BF4D23kbnmxexc11Deman_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi Chris,<= /p>

I want to have wmplayer as p= art of my automitized test for a headset via the USB HID.=

I want to be able to execute= some of the following operations in my python script:

1= .   &= nbsp;   Play<= /p>

2= .   &= nbsp;   Get playing track =

3= .   &= nbsp;   Next<= /p>

4= .   &= nbsp;   Get active device<= /o:p>

5= .   &= nbsp;  

I am not sure if you are abl= e to do this with your project

 

Best regards / Med venlig hi= lsen

Deo

 

 

-----Original Message-----
From: Python-list [mailto:python-list-bounces+demu=3Dsenncom.com@python= .org] On Behalf Of Chris Angelico
Sent: 3. juni 2014 10:58
Cc: python-list@python.org
Subject: Re: Automating windows media player on win7

 

On Tue, Jun 3, 2014 at 6:10 PM, Deogratius Musiig= e <DMusiige@sennheisercommunication= s.com> wrote:

> Hi guys,

> 

> 

> 

> I have been fighting with automating wmplaye= r 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 i= t 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 =3D Dispatch("WMPlayer.OCX")

> 

> tune =3D mp.newMedia("./plays.wav"= )

> 

> mp.currentPlaylist.appendItem(tune)

> 

> mp.controls.play()

> 

> raw_input("Press Enter to stop playing&= quot;)

> 

> mp.controls.stop()

> 

> 

> 

> Br

> 

> Deo

 

First suggestion: post plain text to this list, n= ot HTML. You don't need it to look like the above. :)

 

Secondly: Is there a particular reason that you n= eed to be automating Windows Media Player specifically? I have a similar pr= oject which works by sending keystrokes, which means it works with anything= that reacts to keys; mainly, I use it with VLC. It can invoke a movie or audio file, can terminate the proces= s, and can send a variety of commands via keys. It's designed to be used on= a (trusted) LAN.

 

Code is here:

https://github.com/Rosu= av/Yosemite

 

Once something's invoked by the Yosemite project,= it simply runs as normal inside VLC. Easy to debug audio problems, because= they're managed the exact same way. Granted, this does assume that it's gi= ven full control of the screen (it's designed to manage full-screen video playback; in fact, my siblings are ri= ght now watching Toy Story 3 in the other room, using an old laptop driving= a TV via S-Video, all managed via the above project), so it may not be ide= al for background music on a computer you use for other things; but feel free to borrow ideas and/or code from t= here. (And for what it's worth, I use this as one of my sources of BGM when= I'm coding - just let it invoke the file, then manually flip focus back to= what I'm doing.)

 

ChrisA

--

https= ://mail.python.org/mailman/listinfo/python-list

--_000_A804AEE67207BF42BAF8CEC79839C8D613BF4D23kbnmxexc11Deman_--