Page 6 of 8

Re: AudioEndpoint

Posted: Mon Jun 26, 2017 10:13 am
by Snowbird
jonib wrote:
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
for some unknown reason I'm getting this error on one of my computer :

Code: Select all

12:04:32   Error loading plugin file: C:\ProgramData\EventGhost\plugins\AudioEndpoint
12:04:32   Traceback (most recent call last) (0.5.0-rc2):
12:04:32     File "C:\ProgramData\EventGhost\plugins\AudioEndpoint\__init__.py", line 20, in <module>
12:04:32       import AudioEndpointControl
12:04:32     File "C:\ProgramData\EventGhost\plugins\AudioEndpoint\AudioEndpointControl\__init__.py", line 17, in <module>
12:04:32       from comtypes.gen.MMDeviceAPILib import MMDeviceEnumerator as _MMDeviceEnumerator, IMMDeviceEnumerator as _IMMDeviceEnumerator, IMMNotificationClient
12:04:32   ImportError: cannot import name MMDeviceEnumerator
I don't understand what went wrong it used to work perfectly, following a system crash (I think) it's not working anymore. I reinstalled EG RC2, even reinstalled the AudioEndpoint plugin (latest version, and also older) just to be on the safe side, but I still can not import this plugin... Any thoughts on this ?

Re: AudioEndpoint

Posted: Mon Jun 26, 2017 12:07 pm
by jonib
Snowbird wrote:I don't understand what went wrong it used to work perfectly, following a system crash (I think) it's not working anymore. I reinstalled EG RC2, even reinstalled the AudioEndpoint plugin (latest version, and also older) just to be on the safe side, but I still can not import this plugin... Any thoughts on this ?
This file "_2FDAAFA3_7523_4F66_9957_9D5E7FE698F6_0_1_0.py" gets automatically generated and I'm guessing it is corrupted or wrong version, I'm not sure where it is on your system, but try to find it and delete (or move) it and try again.

jonib

Re: AudioEndpoint

Posted: Mon Jun 26, 2017 12:51 pm
by Snowbird
jonib wrote:This file "_2FDAAFA3_7523_4F66_9957_9D5E7FE698F6_0_1_0.py" gets automatically generated and I'm guessing it is corrupted or wrong version, I'm not sure where it is on your system, but try to find it and delete (or move) it and try again.

jonib
Thanks, it worked !! :D

if this happens to anyone else, the files are located here, just delete them all and restart EG :
%LOCALAPPDATA%\Temp\comtypes_cache\EventGhost-27

Re: AudioEndpoint

Posted: Mon Jun 26, 2017 5:20 pm
by jonib
Snowbird wrote:Thanks, it worked !! :D
Great.

I'll see if it can be fixed automatically in my AudioEndpointControl Library when I work on it next time. GitHub issue.

jonib

Re: AudioEndpoint

Posted: Wed Aug 16, 2017 10:53 am
by Luca Brasi
hey guys,
I'm struggling with checking if one specific audio device is connected. Sorry if that has been discussed here somewhere, I couldn't find any info for that.
I tried to set audio on the disconnected device hopping to get some error then but there was none. Apparently AudioEndpoint is setting the volume on the disconnected device. But of course I will not get a volume change from the system then. So I could use that for determining the connection status but I was thinking that there has to be an easier way?

[Edit:] Some more info: AudioEndpoint will even give me an event with the new volume on the disconnected device which might be a logical thing to do. It just doesn't help me with my workaround. I'm handling it now with System.Volume event which is not triggered.

Re: AudioEndpoint

Posted: Wed Aug 16, 2017 9:15 pm
by Sem;colon
You get a state change even when you plug/unplug an audio endpoint, just write a variable on these events and check that variable when you need to know if it's connected or not

Re: AudioEndpoint

Posted: Wed Aug 16, 2017 10:10 pm
by Luca Brasi
I'm doing that of course. It's just that this fails sometimes. I guess around sleep/wake. So I wanted to build in some kind of check if the avr is there or not because I don't want some other actions to be triggered until it is. It's no biggie I'll work around it.

Code: Select all

try:
    eg.plugins.System.ChangeMasterVolumeBy(-1.0, u'TX-SR607-14 (NVIDIA High Defini')
except:
    print 'Error for amp volume change - Amp not present'
    eg.globals.amp_connected = 0
else:
    print 'Amp Volume change succesful - Amp is connected'
    eg.globals.amp_connected = 1
    eg.plugins.System.ChangeMasterVolumeBy(1.0, u'TX-SR607-14 (NVIDIA High Defini')
Or maybe a little bit more robutst

Code: Select all

eg.globals.amp_connected = 0
from eg.WinApi import SoundMixer
print SoundMixer.GetMixerDevices()
device = "TX-SR607"
devdict = SoundMixer.GetMixerDevices()
for k in devdict:
    if device in devdict[k]:
        eg.globals.amp_connected = 1
        print 'Amp is connected'
        break
    else:
        pass
print 'eg.globals.amp_connected = '+str(eg.globals.amp_connected)

Re: AudioEndpoint

Posted: Wed Sep 20, 2017 7:40 am
by Xepo
Hi guys,

Im trying to detect when windows is playing audio. Any source, any sound, basically whenever the soundcard is transmitting a signal to the speakers.

Is this somehow possible with this plugin?

Thanks,
Bob

Re: AudioEndpoint

Posted: Thu Aug 30, 2018 7:29 pm
by nYce
Hey guys,

i want to use this plugin to change the default audio output devices.
But after some time my actions get to:

AudioEndpoint: ???

after reconfiguring it (doubleclick), i can rechoose my devices and everything is fine again..
audioendpoint01.jpg

it seems like the plugin gets messed up and doesn't remember my devices if i disconnect and connect them again or something..

anyone got an idea on that? is there even a newer plugin for my task?

LG nYce

Re: AudioEndpoint

Posted: Fri Aug 31, 2018 11:46 am
by Sem;colon
Hmm, seems like the ID of your audio devices changed.

Maybe you plug your device in a different socket/port?
Make sure you always use the same port when connecting disconnecting a device!

Also this can happen sometimes after an driver update or after an OS upgrade.

Re: AudioEndpoint

Posted: Thu Sep 13, 2018 8:43 pm
by pralima87
This plugin is causing some severe slowdown on my system if "state changes" is selected.

Re: AudioEndpoint

Posted: Wed Nov 14, 2018 4:25 pm
by loveleejohn
nYce wrote:
Thu Aug 30, 2018 7:29 pm
Hey guys,

i want to use this plugin to change the default audio output devices.
But after some time my actions get to:

AudioEndpoint: ???

after reconfiguring it (doubleclick), i can rechoose my devices and everything is fine again..

audioendpoint01.jpg


it seems like the plugin gets messed up and doesn't remember my devices if i disconnect and connect them again or something..

anyone got an idea on that? is there even a newer plugin for my task?

LG nYce
I am also experiencing this exact problem in Windows 10 Professional. Not sure what might be causing the issue. I guess I'll give Nircmd a try since I have it installed anyway. Just wish there was an easier way. :cry:

Re: AudioEndpoint

Posted: Sun Nov 25, 2018 4:57 pm
by Sem;colon
Hey Everyone!
A new version is here, tackling the Windows 10 - devices disappear problem!

v2.3.2:
-Fixed a bug: "Get Default Audio Device" was not working in combination with "Set Volume"
-Added action: "Get Audio Device By Name" to get an audio device by its name instead of its unique ID. You can use wildcards. The first device where the name matches will be returned to be used in one of the other actions - for example, to change the default audio device. This is useful when running Windows 10, as after OS upgrades and/or driver updates the IDs that are used to reference an AudioEndpoint can change, but the name usually stays the same.
-Some small bugfixes
-Updated AudioEndpointControl lib by jonib with the latest sources, this (hopefully) increased the stability
This version is not tested with EG 0.4 and therefore may not work with it!

As always, get it from the first post!

Re: AudioEndpoint

Posted: Sun Nov 25, 2018 7:13 pm
by Neytrino-OnLine
Sem;colon, hi . Is there a way to get full list of audio devices (by Python)? I understand that I could make it by switching default device to the next (collecting ID's), but it would be desirable to get the list without switching the device...

Re: AudioEndpoint

Posted: Sun Nov 25, 2018 9:10 pm
by Sem;colon
Neytrino-OnLine wrote:
Sun Nov 25, 2018 7:13 pm
Sem;colon, hi . Is there a way to get full list of audio devices (by Python)?
sure, here you go:

All outputs by id:

Code: Select all

eg.plugins.AudioEndpoint.plugin.AudioDeviceIDs[0]
All outputs by name:

Code: Select all

eg.plugins.AudioEndpoint.plugin.AudioDeviceNames[0]
but I'm curious about your use-case? :)