AudioEndpoint

Questions and comments specific to a particular plugin should go here.

Re: AudioEndpoint

Postby jonib » Tue Dec 13, 2016 7:13 pm

Sem;colon wrote:hmm, looks like the new lib form version 2.1 only works with EG version 0.5 and up.
You are missing the "stdole.py" and "MMDeviceAPILib.py" files that are needed for EG 0.4 as comtypes can't generate them.
The comtypes in Python 2.7 don't have the problem so it works in EG 0.5 that uses 2.7.

There is also a period missing in the "AudioEndpointControl\__init__.py" file, line 13 should be:
Code: Select all
try:
   from .MMDeviceAPILib import MMDeviceEnumerator as _MMDeviceEnumerator, IMMDeviceEnumerator as _IMMDeviceEnumerator, IMMNotificationClient
except ImportError:
Or it can't import the MMDeviceAPILib module, because I added the "absolute_import" directive. sorry about that.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
jonib
Plugin Developer
 
Posts: 1244
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: AudioEndpoint

Postby Luca Brasi » Mon Dec 19, 2016 9:04 am

Hi Sem;colon,

great plugin! It would have spared me from a lot of messing around with usb uids if I had seen it before :D

I've got one problem though with EG 0.41.1722 and 2.0 of the plugin on Win 10:
Whenever I trigger Get Default Audio Device I will only get 0, 1 or 2 as the returned value. The 0, 1 and 2 goes back to the settings of role and flow in the action.
Code: Select all
09:54:00   AudioEndpoint: Get Default Audio Device: 0
09:54:00      AudioEndpoint: Get Default Audio Device: 0


Logging of plugged in and unplugged devices is working fine though:
Code: Select all
09:54:14   AudioEndpoint.State.DISABLED.Kopfhörer (Jabra MOVE v2.5.0 Hands-Free) [u'{0.0.0.00000000}.{12fc7fa8-193c-4420-94d9-4656a10703fe}']
09:54:14   AudioEndpoint.State.UNPLUGGED.Kopfhörer (Jabra MOVE v2.5.0 Stereo) [u'{0.0.0.00000000}.{212617be-6055-44a9-b1b8-06f2d89faf9b}']
09:54:14   AudioEndpoint.State.UNPLUGGED.Kopfhörer (Jabra MOVE v2.5.0 Hands-Free) [u'{0.0.1.00000000}.{fa76e6bb-c21b-4fe9-b328-3b9593523431}']
09:54:15   AudioEndpoint.State.NOTPRESENT.TX-SR607-14 (NVIDIA High Definition Audio) [u'{0.0.0.00000000}.{3d8020f8-a3f8-41f4-ac1d-9fbb51813d18}']
09:54:15   AudioEndpoint.State.ACTIVE.TX-SR607-14 (NVIDIA High Definition Audio) [u'{0.0.0.00000000}.{3d8020f8-a3f8-41f4-ac1d-9fbb51813d18}']
09:54:15   AudioEndpoint.Default.Render.Console.TX-SR607-14 (NVIDIA High Definition Audio) [u'{0.0.0.00000000}.{3d8020f8-a3f8-41f4-ac1d-9fbb51813d18}']
09:54:15   AudioEndpoint.Default.Render.Multimedia.TX-SR607-14 (NVIDIA High Definition Audio) [u'{0.0.0.00000000}.{3d8020f8-a3f8-41f4-ac1d-9fbb51813d18}']
09:54:15   AudioEndpoint.Default.Render.Communications.TX-SR607-14 (NVIDIA High Definition Audio) [u'{0.0.0.00000000}.{3d8020f8-a3f8-41f4-ac1d-9fbb51813d18}']


Any idea what is going wrong here?
Win8.1 x64 Prof. / Eventghost latest / auvisio vrc-1100-plugin and MCE Plugin / auvisio vrc-1100 and MCE Receiver / Logitech Harmony Hub / MediaPortal
User avatar
Luca Brasi
Experienced User
 
Posts: 228
Joined: Sat Oct 11, 2008 12:39 pm

Re: AudioEndpoint

Postby Sem;colon » Mon Dec 19, 2016 8:33 pm

Hello Luca Brasi,

you're welcome! :)
Actually, "Get Default Audio device" returns a dict, but you can't see it in the Log.
You can reference it by "eg.result" in the action you trigger after "Get Default Audio device".


Another thing:
I applied the suggested lib changes by jonib two posts above in the attached test version.
Can please somebody test it with EG 0.4 and let me know if it works? (I would have to downgrade EG to test it...)

Thank you!
Attachments
AudioEndpoint.egplugin
v2.1.0 (modified AudioEndpointControl lib)
(39.11 KiB) Downloaded 81 times
Sem;colon
Experienced User
 
Posts: 579
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: AudioEndpoint

Postby jonib » Mon Dec 19, 2016 8:56 pm

Sem;colon wrote:Can please somebody test it with EG 0.4 and let me know if it works? (I would have to downgrade EG to test it...)
Seems to work for me on 0.4, no lockup on install and I get events. Just a quick test.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
jonib
Plugin Developer
 
Posts: 1244
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: AudioEndpoint

Postby kkl » Mon Dec 19, 2016 9:09 pm

Sem;colon wrote:Another thing:
I applied the suggested lib changes by jonib two posts above in the attached test version.
Can please somebody test it with EG 0.4 and let me know if it works? (I would have to downgrade EG to test it...)

Thank you!

Hi Sem;colon,

Just tried it out with 0.4.1.r1722. Tried a few actions. Seems to be working fine. Thanks for updating.
kkl
Experienced User
 
Posts: 305
Joined: Wed May 04, 2011 9:32 pm

Re: AudioEndpoint

Postby Sem;colon » Wed Dec 28, 2016 8:00 pm

Thank you for testing!!

So, here is the new version:
v2.1.2:
-Added options to the plugin what events you like the plugin to be triggered (volume/mute events, device state events and advanced device state events(new))
-Some bug fixes
-Modified version of the AudioEndpointControl by jonib, should work with EG 0.4 and 0.5

Get it from the first post!
Sem;colon
Experienced User
 
Posts: 579
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: AudioEndpoint

Postby yasuo » Sun Feb 19, 2017 5:16 pm

Working great. thank you.
Using it to change sound between speakers and hdmi.

any idea how to play a sound to specific device?
i could change the "communication device" to my usb-soundcard wich is connected to a 433mhz-converter to play a digital signal for controling my wireless sockets, but not sure how to "play to communication device" or "play to specific device".

current workaround to start a portable media player wich is preconfigured to use my usb soundcard but its quite a dirty hack
yasuo
 
Posts: 26
Joined: Sun Aug 11, 2013 2:34 pm

Re: AudioEndpoint

Postby saue0 » Tue May 02, 2017 5:20 pm

Hi all.
Very nice plugin.

Here a new version taking care of microphone as well.....
Please pe carefull.

Sem;colon can you verifiy what i did to see if it's OK.

Thanks
Attachments
__init__.py
(29 KiB) Downloaded 48 times
saue0
 
Posts: 4
Joined: Sat Mar 28, 2009 12:28 pm

Re: AudioEndpoint

Postby saue0 » Wed May 03, 2017 1:28 pm

Oupss did not correctly merge with version 2.1.2

Here a new copy
Attachments
__init__.py
(28.97 KiB) Downloaded 50 times
saue0
 
Posts: 4
Joined: Sat Mar 28, 2009 12:28 pm

Re: AudioEndpoint

Postby Sem;colon » Wed May 03, 2017 5:09 pm

Nice! :)

So from a design point of view, I'd prefer to have new actions for "SetCapture" etc. instead of integrating them into the "SetRender" etc. actions as parameter "flow". Just because of the function names. (SetRender)

On the other hand, "SetDefaultVolume" and "GetDefaultVolume" etc. functions can be integrated as first selection of the list for the "SetVolume" and "GetVolume" actions. However, I didn't include this functionality on purpose, as it's redundant to the Volume features that are integrated in the EventGhost default. (System plugin)
Sem;colon
Experienced User
 
Posts: 579
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: AudioEndpoint

Postby loveleejohn » Fri May 05, 2017 4:47 pm

Hey there Sem;Colon! Just wanted to drop in and say thanks for a really neat plugin!
loveleejohn
Experienced User
 
Posts: 124
Joined: Thu Dec 10, 2015 12:09 am

Re: AudioEndpoint

Postby saue0 » Fri May 05, 2017 4:56 pm

I have added the SetCapture.
i also did a small change in SetRender, to display only the Render devices.

You will probably need to delete any SetRender already in your scrips, since i removed 1 parameter that i added in the other release.

I need to keep the SetDefaultVolume/Mute since i want to use them for setting mute and volume for the delault comunication device, I have 2 sound card on my PC.
The laptop default and a Wireless HeadSet with a USB connection.

I have a problem wen setting mute for the microphone.
the laptop and headset get mute a the same time, Seem related to windows not EG.

There a peace of code that may need rewrite... inside SetRender and SetCapture

def all_indices(self, value, qlist):
indices = []
idx = -1
while True:
try:
idx = qlist.index(value, idx+1)
indices.append(idx)
except ValueError:
break
return indices

def Configure(self,target="",role=0):
roles=["Console","Multimedia","Communications"]
panel = eg.ConfigPanel(self)

wx_role = wx.Choice(panel, -1, choices=roles)
wx_role.SetSelection(role)
st_role = panel.StaticText(self.Text.role)

idx = self.all_indices(0, self.plugin.AudioDeviceFlows)
if target in self.plugin.AudioDeviceIDs and self.plugin.AudioDeviceIDs.index(target) in idx:
target = idx.index(self.plugin.AudioDeviceIDs.index(target))

else:
target = 0
wx_setTo = wx.Choice(panel, -1, choices= [row for row in self.plugin.AudioDeviceNames if self.plugin.AudioDeviceFlows[self.plugin.AudioDeviceNames.index(row)] == 0] )
wx_setTo.SetSelection(target)
st_setTo = panel.StaticText(self.Text.setTo)

panel.AddLine(st_role,wx_role)
panel.AddLine(st_setTo,wx_setTo)

while panel.Affirmed():
panel.SetResult(self.plugin.AudioDeviceIDs[idx[wx_setTo.GetCurrentSelection()]],wx_role.GetCurrentSelection())
Attachments
__init__.py
(33.78 KiB) Downloaded 50 times
saue0
 
Posts: 4
Joined: Sat Mar 28, 2009 12:28 pm

Re: AudioEndpoint

Postby Sem;colon » Mon May 22, 2017 9:17 pm

New version!

v2.2.1:
-Replaced action "Set Default Audio Render" with "Set Default Audio Device" (you can now choose the role and flow direction of the default device you would like to set)(your configured actions will still work, but you'll need to add the new one if you like to add or change something)
-Replaced action "Next Default Audio Render" with "Next Default Audio Device" (you can now choose the role and flow direction of the default device you would like to set)(your configured actions will still work, but you'll need to add the new one if you like to add or change something)
-Replaced action "Previous Default Audio Render" with "Previous Default Audio Device" (you can now choose the role and flow direction of the default device you would like to set)(your configured actions will still work, but you'll need to add the new one if you like to add or change something)
-Extended actions "Get Mute", "Set Mute", "Get Volume" and "Set Volume" by the possibility to set settings for capture devices
-Extended actions "Get Mute", "Set Mute", "Get Volume" and "Set Volume" by the possibility to use the output of the "Get Default Audio Device" action to determine which audio device should be changed

Get it from the first post!

@saue0: I added the requested functionality, but a little differently ;)
Sem;colon
Experienced User
 
Posts: 579
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: AudioEndpoint

Postby Snowbird » Tue May 30, 2017 5:59 pm

Thank you for this update !!
That's a really cool plugin and works great ! ;)
Snowbird
Experienced User
 
Posts: 115
Joined: Fri Jul 03, 2009 10:04 am

Re: AudioEndpoint

Postby smbs » Sun Jun 11, 2017 6:52 pm

plugin v2.2.1 not showing up in add plugin list in category "others" running win 8.1 pro
works fine in win10 and is found under "others"
Any help would be great
thanx
smbs
 
Posts: 5
Joined: Fri Apr 28, 2017 2:28 pm

PreviousNext

Return to Plugin Support

Who is online

Users browsing this forum: No registered users and 4 guests