Core Audio Plugin
Posted: Tue Aug 06, 2019 4:05 am
Core Audio
Inspired by the AudioEndpoint plugin
v0.4.0a
EventGhost 0.5.0 and newer
This plugin is very much still a work in progress. If you encounter any problems or undesired behavior please follow the template below for reporting an issue to me.
Trouble Report Template
This plugin was inspired by the Audio Endpoint plugin made by sem;colon and Jonib.
Events:
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.Session.{SESSION NAME}.Created
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.{SESSION NAME}.NameChanged
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.{SESSION NAME}.GroupChanged
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.{SESSION NAME}.IconChanged
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.{SESSION NAME}.Disconnected
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.{SESSION NAME}.Volume.{0.0000 - 100.0000}
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.{SESSION NAME}.MuteOn
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.{SESSION NAME}.MuteOff
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.{SESSION NAME}.AudioPlayback.Started
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.{SESSION NAME}.AudioPlayback.Stopped
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.{SESSION NAME}.AudioPlayback.Expired
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.Volume.{0.0000 - 100.0000}
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.MuteOff
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.MuteOn
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.Channel.{CHANNEL NUMBER}.Volume.{0.0000 - 100.0000}
CoreAudio.Device.{DEVICE NAME}.Added
CoreAudio.Device.{DEVICE NAME}.Removed
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.Default.Render
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.Default.Capture
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.Default.All
This plugin triggers events for the audio starting and stopping, part for the event is going to be the name of the application causing the event.
This is a little twist for ya. This plugin does not have actions in the traditional sense. The actions are not located under the plugin. This plugin extends the System plugin and overrides the volume actions for the system plugin.
Here is a list of the actions again remember these actions are going to show up under the System plugin.
with any of the volume actions you have a relative and an absolute. relative means you want to increase or decrease the volume from it's current level. so say you have the volume at 30% and you set 10% in one of the relative actions. it is going to make the volume 40%
absolute is whatever you set in the action that is going to be the new volume level.
GetEndpointVolume
SetEndpointVolumeAbsolute
SetEndpointVolumeRelative
You now have volume control over each individual channel. so if you wanted to only turn down you subwoofer.. you can now do that
GetEndpointChannelVolume
SetEndpointChannelVolumeAbsolute
SetEndpointChannelVolumeRelative
IsDeviceAttached
IsDeviceEnabled
GetEndpointMute
SetEndpointMute
ToggleEndpointMute
IsPlaybackEndpointActive
IsDefaultPlaybackEndpoint
GetDefaultPlaybackEndpoint
SetDefaultPlaybackEndpoint
IsDefaultRecordingEndpoint
GetDefaultRecordingEndpoint
SetDefaultRecordingEndpoint
I need to go over the importance of the IsDeviceAttached action. This is for the people that are running EG on a remote PC and administer it via RDP.
I need to explain what the problem is and then how this next action fixes that issue.
Here is the setup.
You have a PC running EG that you set up so you can RDP into it for administrative purposes.
you set an action to change the volume. This is all working as it should until you RDP into the computer. Then the bad things start to happen. Let me explain why bad things happen and then you will understand why this action is so important.
So when a single user is signed into Windows that user has direct access to the devices (kind of). When you sign in via RDP because you are not physically at that computer you cannot have direct access to the device. Windows sets up a virtual device that acts as a go between. this is the device that shows up instead of the actual device. Because this takes place when a macro runs to say change the volume you will get an error. The error is a wee bit more complex but that is the quick and dirty version of it.
This action allows you to check to see if the device exists before doing anything to it. This is an example of how to set it up
Now you can see how this is going to work to solve that issue!
**UPDATED**
version 0.3.0a
version 0.4.1a
Inspired by the AudioEndpoint plugin
v0.4.0a
EventGhost 0.5.0 and newer
This plugin is very much still a work in progress. If you encounter any problems or undesired behavior please follow the template below for reporting an issue to me.
Trouble Report Template
Code: Select all
Windows Version: {10}
Windows Build: {1806}
Description of problem: Please provide as much detail as possible.
If the problem can be recreated then describe the steps needed to reproduce the issue.
If there is not an error and you are experiencing undesired behavior. Explain what is happening and then tell me what is supposed to be happening.
Error (if any):
[ code ]
If there is an error then copy the error and paste it here. I need all lines of the error.
Make sure you remove the spaces in the code tag above and below the error.
[ /code ]
Fix:
[ code ]
If you happen to have fixed the issue then please paste the code here. remove the spaces in the tags please.
[ /code ]
Events:
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.Session.{SESSION NAME}.Created
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.{SESSION NAME}.NameChanged
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.{SESSION NAME}.GroupChanged
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.{SESSION NAME}.IconChanged
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.{SESSION NAME}.Disconnected
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.{SESSION NAME}.Volume.{0.0000 - 100.0000}
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.{SESSION NAME}.MuteOn
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.{SESSION NAME}.MuteOff
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.{SESSION NAME}.AudioPlayback.Started
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.{SESSION NAME}.AudioPlayback.Stopped
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.{SESSION NAME}.AudioPlayback.Expired
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.Volume.{0.0000 - 100.0000}
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.MuteOff
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.MuteOn
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.Channel.{CHANNEL NUMBER}.Volume.{0.0000 - 100.0000}
CoreAudio.Device.{DEVICE NAME}.Added
CoreAudio.Device.{DEVICE NAME}.Removed
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.Default.Render
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.Default.Capture
CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.Default.All
This plugin triggers events for the audio starting and stopping, part for the event is going to be the name of the application causing the event.
This is a little twist for ya. This plugin does not have actions in the traditional sense. The actions are not located under the plugin. This plugin extends the System plugin and overrides the volume actions for the system plugin.
Here is a list of the actions again remember these actions are going to show up under the System plugin.
with any of the volume actions you have a relative and an absolute. relative means you want to increase or decrease the volume from it's current level. so say you have the volume at 30% and you set 10% in one of the relative actions. it is going to make the volume 40%
absolute is whatever you set in the action that is going to be the new volume level.
GetEndpointVolume
SetEndpointVolumeAbsolute
SetEndpointVolumeRelative
You now have volume control over each individual channel. so if you wanted to only turn down you subwoofer.. you can now do that
GetEndpointChannelVolume
SetEndpointChannelVolumeAbsolute
SetEndpointChannelVolumeRelative
IsDeviceAttached
IsDeviceEnabled
GetEndpointMute
SetEndpointMute
ToggleEndpointMute
IsPlaybackEndpointActive
IsDefaultPlaybackEndpoint
GetDefaultPlaybackEndpoint
SetDefaultPlaybackEndpoint
IsDefaultRecordingEndpoint
GetDefaultRecordingEndpoint
SetDefaultRecordingEndpoint
I need to go over the importance of the IsDeviceAttached action. This is for the people that are running EG on a remote PC and administer it via RDP.
I need to explain what the problem is and then how this next action fixes that issue.
Here is the setup.
You have a PC running EG that you set up so you can RDP into it for administrative purposes.
you set an action to change the volume. This is all working as it should until you RDP into the computer. Then the bad things start to happen. Let me explain why bad things happen and then you will understand why this action is so important.
So when a single user is signed into Windows that user has direct access to the devices (kind of). When you sign in via RDP because you are not physically at that computer you cannot have direct access to the device. Windows sets up a virtual device that acts as a go between. this is the device that shows up instead of the actual device. Because this takes place when a macro runs to say change the volume you will get an error. The error is a wee bit more complex but that is the quick and dirty version of it.
This action allows you to check to see if the device exists before doing anything to it. This is an example of how to set it up
Code: Select all
macro 1:
some_event
IsDeviceAttached
Jump If to Macro 2 with no return
SetEndpointVolumeAbsolute (Virtual sound device)
macro 2:
SetEndpointVolumeAbsolute (Physical sound device)
**UPDATED**
version 0.3.0a
- adds action PlaybackEndpointHasOutput - checks if the endpoint is currently outputting audio. there is a low volume threshold you can set
- adds action RecordingEndpointHasInput - check if a capture endpoint is receiving audio, there is a low volume threshold you can set.
- fixes traceback reported by @gibman viewtopic.php?p=53559#p53559
- Adds plugin description
- adds events for audio output detection and input detection events are as follows
- CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.AudioOutput.Started
- CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.AudioOutput.Stopped
- CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.AudioInput.Started
- CoreAudio.{DEVICE NAME}.{ENDPOINT NAME}.AudioInput.Stopped
version 0.4.1a
- fixes traceback when a volume event occurs.
- fixes unicode encoding problem
- replaces clumsy volume control in the endpoint volume and channel volume actions.
- fixes traceback ocuring with no default endpoint is available.
- hopefully fixes traceback issue with the session id's
- removes redundant device name from the endpoint name.
so an event like this onenow becomes thisCode: Select all
CoreAudio.Realtek High Definition Audio.Speakers (Realtek High Definition Audio).Volume.29.0000
Code: Select all
CoreAudio.Realtek High Definition Audio.Speakers.Volume.29.0000
- another crack at the unicode issues