Page 5 of 8

Re: AudioEndpoint

Posted: Tue Dec 13, 2016 7:13 pm
by jonib
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

Re: AudioEndpoint

Posted: Mon Dec 19, 2016 9:04 am
by Luca Brasi
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?

Re: AudioEndpoint

Posted: Mon Dec 19, 2016 8:33 pm
by Sem;colon
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!

Re: AudioEndpoint

Posted: Mon Dec 19, 2016 8:56 pm
by jonib
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

Re: AudioEndpoint

Posted: Mon Dec 19, 2016 9:09 pm
by kkl
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.

Re: AudioEndpoint

Posted: Wed Dec 28, 2016 8:00 pm
by Sem;colon
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!

Re: AudioEndpoint

Posted: Sun Feb 19, 2017 5:16 pm
by yasuo
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

Re: AudioEndpoint

Posted: Tue May 02, 2017 5:20 pm
by saue0
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

Re: AudioEndpoint

Posted: Wed May 03, 2017 1:28 pm
by saue0
Oupss did not correctly merge with version 2.1.2

Here a new copy

Re: AudioEndpoint

Posted: Wed May 03, 2017 5:09 pm
by Sem;colon
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)

Re: AudioEndpoint

Posted: Fri May 05, 2017 4:47 pm
by loveleejohn
Hey there Sem;Colon! Just wanted to drop in and say thanks for a really neat plugin!

Re: AudioEndpoint

Posted: Fri May 05, 2017 4:56 pm
by saue0
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())

Re: AudioEndpoint

Posted: Mon May 22, 2017 9:17 pm
by Sem;colon
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 ;)

Re: AudioEndpoint

Posted: Tue May 30, 2017 5:59 pm
by Snowbird
Thank you for this update !!
That's a really cool plugin and works great ! ;)

Re: AudioEndpoint

Posted: Sun Jun 11, 2017 6:52 pm
by smbs
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