Get off the list

2015-06-18 Thread Deogratius Musiige
Hi,
How can i get off this mailing list?

Best regards / Med venlig hilsen

Deogratius Musiige
Software Development Engineer

Sennheiser Communications A/S
Industriparken 27
DK-2750 Ballerup

Direct  +45 5618 0320
Mail d...@senncom.com
Webwww.sennheiser.com



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


Skype

2014-07-31 Thread Deogratius Musiige
Hi guys,

Has anybody tried or have an idea how to:
1. start up skype from python,
2. simulate an incoming call.

Thanks 

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


RE: Skype

2014-07-31 Thread Deogratius Musiige
Yes, i picked up the skype4Py package where I can start up skype and place a 
call. But I want to have 2 clients which can call each other.

Best regards / Med venlig hilsen

Deogratius Musiige
Sennheiser Communications A/S
Direct  +45 5618 0320


From: Joel Goldstick [mailto:joel.goldst...@gmail.com]
Sent: 31. juli 2014 15:57
To: Deogratius Musiige
Cc: python-list@python.org
Subject: Re: Skype

Have you checked googling 'skype python'?  I just did.  Looks like several 
libraries and a tutorial in the first couple of listings.  I haven't tried, but 
it sounds interesting

On Thu, Jul 31, 2014 at 8:43 AM, Deogratius Musiige 
dmusi...@sennheisercommunications.commailto:dmusi...@sennheisercommunications.com
 wrote:
Hi guys,

Has anybody tried or have an idea how to:
1. start up skype from python,
2. simulate an incoming call.

Thanks

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



--
Joel Goldstick
http://joelgoldstick.com
-- 
https://mail.python.org/mailman/listinfo/python-list


RE: Automating windows media player on win7

2014-07-23 Thread Deogratius Musiige
Hi mate,



The fix you provided works perfect. However, if I put it in a class and import, 
make instance and execute in another file, the audio is not played.

What am I missing? This is what I do:



FileA.py
class WMPlayer():
'''
@
'''
#static var
#first instance is a primary , following are secondary.
#you can have one primary and as many secondary as you like
def __init__(self):
'''
init all attributes
'''
#self.mp = Dispatch(WMPlayer.OCX)
#pass

def play_song(self):
mp = Dispatch(WMPlayer.OCX)
tune = mp.newMedia(r./SleepAway.mp3)
mp.currentPlaylist.appendItem(tune)
mp.controls.play()
sleep(1)
mp.controls.playItem(tune)
raw_input(Press Enter to stop playing)
#sleep(5)

mp.controls.stop()



FileB.py

from wmp.WMPlayer import *



class sTest(unittest.TestCase):


def test_wmplayer(self):
self.wmp = WMPlayer()

self.wmp.play_song()







Best regards / Med venlig hilsen



Deogratius Musiige

Sennheiser Communications A/S

Direct +45 5618 0320





-Original Message-
From: Python-list [mailto:python-list-bounces+demu=senncom@python.org] On 
Behalf Of Deogratius Musiige
Sent: 6. juni 2014 15:39
To: MRAB; python-list@python.org
Subject: RE: Automating windows media player on win7



Thanks a lot mate.



You just made my day.

I have looked around the net but cannot find the controls available.



I would like to be able to:

- get current playing track

- get wmplayer state (playing/paused/stopped)

- get the selected sound device



Thanks a lot



Br

Deo

-Original Message-

From: Python-list [mailto:python-list-bounces+demu=senncom@python.org] On 
Behalf Of MRAB

Sent: 4. juni 2014 21:23

To: python-list@python.orgmailto:python-list@python.org

Subject: Re: Automating windows media player on win7



On 2014-06-03 09:10, 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 = 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()



I've found that adding PlayItem and sleep seems to work:



#! python2.7

# -*- coding: utf-8 -*-

from win32com.client import Dispatch

from time import sleep



mp = Dispatch(WMPlayer.OCX)

tune = mp.NewMedia(r./plays.wav)

mp.CurrentPlaylist.AppendItem(tune)

mp.Controls.Play()

sleep(1)

mp.Controls.PlayItem(tune)

raw_input(Press Enter to stop playing)

mp.Controls.Stop()



--

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



--

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


RE: Automating windows media player on win7

2014-07-23 Thread Deogratius Musiige
Hi,
I have the mentioned imports. And for the matter of fact I can play the audio. 

The problem is when I make a class with the wmplayer automating code and make 
an instance of this class in my testing code.
When I run this instance, I do not get any audio out?

Best regards / Med venlig hilsen

Deogratius Musiige
Sennheiser Communications A/S
Direct  +45 5618 0320


-Original Message-
From: Python-list [mailto:python-list-bounces+demu=senncom@python.org] On 
Behalf Of MRAB
Sent: 23. juli 2014 12:57
To: python-list@python.org
Subject: Re: Automating windows media player on win7

On 2014-07-23 10:20, Deogratius Musiige wrote:

 Hi mate,

 The fix you provided works perfect. However, if I put it in a class 
 and import, make instance and execute in another file, the audio is 
 not played.

 What am I missing? This is what I do:

I'm assuming that you're not actually calling the files FileA.py and FileB.py.

 *FileA.py*

You need these imports:

from win32com.client import Dispatch
from time import sleep

 classWMPlayer():

 '''

 @

 '''

 #static var

 #first instance is a primary , following are secondary.

 #you can have one primary and as many secondary as you like

 def__init__(self):

 '''

 init all attributes

 '''

 #self.mp = Dispatch(WMPlayer.OCX)

 #pass

 defplay_song(self):

 mp = Dispatch(WMPlayer.OCX)

 tune = mp.newMedia(r./SleepAway.mp3)

 mp.currentPlaylist.appendItem(tune)

 mp.controls.play()

 sleep(1)

 mp.controls.playItem(tune)

 raw_input(Press Enter to stop playing)

 #sleep(5)

 mp.controls.stop()

 **

 *FileB.py*

You need this import:

import unittest

 **

 fromwmp.WMPlayer import*

 classsTest(unittest.TestCase):

 deftest_wmplayer(self):

 self.wmp = WMPlayer()

 self.wmp.play_song()

You also need to run the test:

if __name__ == '__main__':
 unittest.main()

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


RE: Automating windows media player on win7

2014-06-06 Thread Deogratius Musiige
Thanks a lot mate. 

You just made my day. 
I have looked around the net but cannot find the controls available. 

I would like to be able to:
- get current playing track
- get wmplayer state (playing/paused/stopped)
- get the selected sound device

Thanks a lot

Br
Deo
-Original Message-
From: Python-list [mailto:python-list-bounces+demu=senncom@python.org] On 
Behalf Of MRAB
Sent: 4. juni 2014 21:23
To: python-list@python.org
Subject: Re: Automating windows media player on win7

On 2014-06-03 09:10, 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 = 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()

I've found that adding PlayItem and sleep seems to work:

#! python2.7
# -*- coding: utf-8 -*-
from win32com.client import Dispatch
from time import sleep

mp = Dispatch(WMPlayer.OCX)
tune = mp.NewMedia(r./plays.wav)
mp.CurrentPlaylist.AppendItem(tune)
mp.Controls.Play()
sleep(1)
mp.Controls.PlayItem(tune)
raw_input(Press Enter to stop playing)
mp.Controls.Stop()

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

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


Automating windows media player on win7

2014-06-03 Thread Deogratius Musiige
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
-- 
https://mail.python.org/mailman/listinfo/python-list


RE: Automating windows media player on win7

2014-06-03 Thread Deogratius Musiige
Thanks for the good info Chris.
I'll look into the project. However, I hope that I can find a solution using 
OCX dispatch.
The dispatch provides all the functionalities I need.

Best regards / Med venlig hilsen
Deo

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

On Tue, Jun 3, 2014 at 7:42 PM, Deogratius Musiige 
dmusi...@sennheisercommunications.com wrote:
 Hi Chris,

 I want to have wmplayer as part 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.   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

Play, definitely. Next, not specifically, but by sending the letter 'n' you can 
achieve that. Active device? Not sure what you mean there.

The one part that doesn't exist is Get playing track. But you could manage 
this the other way around, by not invoking a playlist at all.
If you run vlc --play-and-exit some_file.wav, then when that process 
terminates, the track has finished. Kill the process or send Ctrl-Q to skip to 
the next track. Keep track (pun intended) of what file you've most recently 
invoked.

I'm not sure how this ties in with your headset testing, though.

By the look of things, the Yosemite project isn't a here it is, just deploy 
it solution, but you may find that there's some useful code you can borrow.

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


RE: Automating windows media player on win7

2014-06-03 Thread Deogratius Musiige
Hi Chris,

I want to have wmplayer as part 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.   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=senncom@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 
dmusi...@sennheisercommunications.commailto:dmusi...@sennheisercommunications.com
 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 = 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



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 Windows 
Media Player specifically? I have a similar project 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 
process, 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/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 screen 
(it's designed to manage full-screen video playback; in fact, my siblings are 
right 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 ideal for 
background music on a computer you use for other things; but feel free to 
borrow ideas and/or code from there. (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
-- 
https://mail.python.org/mailman/listinfo/python-list