Trigger only when event is detected 'x' times in 'y' seconds

If you have a question or need help, this is the place to be.
Post Reply
BenGmuN
Posts: 1
Joined: Mon Dec 04, 2017 10:58 am

Trigger only when event is detected 'x' times in 'y' seconds

Post by BenGmuN » Mon Dec 04, 2017 4:26 pm

Hey folks,

I'm looking for a way in which to trigger a macro only when a defined event is detected 'x' number of times in 'y' seconds.

I want to trigger a macro when audio is detected through my PC's line-in. I found a bit of software called 'Audio Zone Trigger' which can run an EXE with parameters when the mic/line-in picks up a noise (so I can directly execute an EG macro), but I don't want it to keep firing over and over. There's nothing in the 3rd party software that allows for such configuration, so I need to do it in EG.

I'm a bit of an EG n00b, and I do not speak Python, so an example would be greatly appreciated.

Many thanks in advance.

User avatar
kgschlosser
Site Admin
Posts: 5498
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Trigger only when event is detected 'x' times in 'y' seconds

Post by kgschlosser » Sat Dec 09, 2017 8:59 pm

Sorry for the late post. I didn't see it there.

There is no way to really prevent an event from taking place..

And that program you found it keeps on calling the exe file over and I er and over again? I find this rather strange behavior. I would imaging it would call the exe once when it detects noise. And if it was a cool program it would allow for the call of a second if there is no audio.

Lete do some looking into that program and see how it works. Then I will be able to advise on what to do.
If you like the work I have been doing then feel free to Image

cvben
Posts: 38
Joined: Wed Jun 07, 2017 8:30 pm

Re: Trigger only when event is detected 'x' times in 'y' seconds

Post by cvben » Tue Jan 02, 2018 3:51 am

I was bored so I installed it and I'm a tad confused.

in the program it looks like you can set a trigger on sound detection, then trigger an action after detection.

I set my Action to "Run File" and pointed it toward "C:\Program Files (x86)\EventGhost\EventGhost.exe" where Eventghost is installed for me. then I set the parameters a "-event test" (minus the quotes) as that triggers and Eventghost event when applied to the commandline. This correctly produced an event "Main.test"

Is that what you are looking for?

piert
Experienced User
Posts: 322
Joined: Tue Jun 14, 2011 2:53 pm

Re: Trigger only when event is detected 'x' times in 'y' seconds

Post by piert » Tue Jan 02, 2018 1:33 pm

I assume that receiving a events is not the problem for topic owner, but rather how to get an event (or action) only when 'event is detected 'x' number of times in 'y' seconds.', as mentioned in his first post.

User avatar
yokel22
Experienced User
Posts: 265
Joined: Thu Feb 05, 2015 5:56 pm
Location: U.S. - Kansas city

Re: Trigger only when event is detected 'x' times in 'y' seconds

Post by yokel22 » Tue Jan 02, 2018 2:18 pm

See if this doesn't suite your purpose. I set it up to test with the keyboard plugin. It will generate an event when you type more than 3 keys in a second. Change the 'maxEvent' & 'timePeriod' variables at the top to fit your needs.

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="0.5.0-rc4">
    <Macro Name="Keyboard action: x Events in x Seconds" XML_Guid="{EEFE16F8-7F91-4A41-8F0F-BEAB192D3A6F}" Expanded="True">
        <Event Name="Keyboard.*" XML_Guid="{3E3CB448-44BC-4785-A018-998A6F87A614}" />
        <Action Name="This will be triggered on every keypress" XML_Guid="{7EA8EDB5-0BC2-437C-88D8-55799E3897B7}">
            EventGhost.Comment()
        </Action>
        <Action XML_Guid="{ECAEEB3C-D5E7-4D67-879D-DF286A8A5246}">
            EventGhost.PythonScript(u'# Modify these two values.\n# Max number of events to recieve before triggering event.\nmaxEvents = 3\n# time in seconds\ntimePeriod = 1\n\n# set event time variable\neg.globals.EventTime = eg.event.time\n    \n# Try to subtract current typing event time minus last typing event time \n# This is for error handling when eg starts, otherwise it will throw an\n# error on the first event.\ntry:                      \n    eventTimeDiff = eg.globals.EventTime - eg.globals.lastEventTime\nexcept:\n    eventTimeDiff = 0\n    \n# Try to get global Event time variable.\n# Error handling for first time event is recieved.\ntry:\n    eg.globals.EventCount\nexcept AttributeError:\n    eg.globals.EventCount = 0\n\n# If last event was less than or equal to set seconds.\nif eventTimeDiff &lt;= timePeriod:\n    # Event matched time period, add event to the count.\n    eg.globals.EventCount = eg.globals.EventCount + 1\n    \n    # if last event greater than max Events in time period.\n    if eg.globals.EventCount &gt;= maxEvents:\n        # Trigger Event, modify to fit your needs.\n        eg.TriggerEvent(prefix="pre", suffix="suff", payload=\'pay\')\n        # Both criteria met, reset event Count.\n        eg.globals.EventCount = 0\n\n# Reset Event Count\nelse:\n    eg.globals.EventCount = 0\n\n# set last event time to the current event time\neg.globals.lastEventTime = eg.event.time\n')
        </Action>
    </Macro>
</EventGhost>

User avatar
kgschlosser
Site Admin
Posts: 5498
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Trigger only when event is detected 'x' times in 'y' seconds

Post by kgschlosser » Tue Jan 02, 2018 5:21 pm

I have been messing around with this a bit. But I wanted to take it one step further. now while i am able to bring in the ability to check for sound on a line in /mic very easily without the need for any external software. I wanted to also be able to check if sound is present on an output. The latter part can be done.there is an interface that has been made called port audio. port audio is simply an interface a dll file. it natively does not support the ability to listen in on the output side. there is a version of it that does exist that does have this ability. the problem is i am having problems compiling it. (learning curve) I am sure I will be able to figure it out at some point. but keep your eyes open for when i post news about it.

I may release a version that does not listen to the output but only the line in and mic. for the time being.
If you like the work I have been doing then feel free to Image

Snowbird
Experienced User
Posts: 374
Joined: Fri Jul 03, 2009 10:04 am

Re: Trigger only when event is detected 'x' times in 'y' seconds

Post by Snowbird » Thu Jan 04, 2018 4:10 pm

Hi,

I'm trying to do something very similar but I'm struggling :)

how can I execute an action only if a specific recurring event is not received within 30 seconds ? if the event is received within the 30 seconds, just wait for the next occurrence of this same specific event.

anyone can help me on this ?

Thank you.

User avatar
kgschlosser
Site Admin
Posts: 5498
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Trigger only when event is detected 'x' times in 'y' seconds

Post by kgschlosser » Thu Jan 04, 2018 4:58 pm

you can use the Timer plugin for this.


use the repeating event to reset the timer (which you have set up to run for 30 seconds) if for some reason that repeating event does not comes in then the timer will run the full 30 seconds after the 30 seconds is up it will trigger an event which is what you would use to run that action.
If you like the work I have been doing then feel free to Image

Snowbird
Experienced User
Posts: 374
Joined: Fri Jul 03, 2009 10:04 am

Re: Trigger only when event is detected 'x' times in 'y' seconds

Post by Snowbird » Thu Jan 04, 2018 5:27 pm

thank you !

it is a good idea, I just tried it but the problem is that there is an event that is triggered all the time even when the repeating event arrives before the 30 seconds limit... Maybe I didn't understand well enough your explanation ?

Snowbird
Experienced User
Posts: 374
Joined: Fri Jul 03, 2009 10:04 am

Re: Trigger only when event is detected 'x' times in 'y' seconds

Post by Snowbird » Thu Jan 04, 2018 5:45 pm

never mind :) go it sorted out !

thank you again

User avatar
kgschlosser
Site Admin
Posts: 5498
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Trigger only when event is detected 'x' times in 'y' seconds

Post by kgschlosser » Fri Jan 05, 2018 1:10 am

I knew you could do it.

You have been poking about EG long enough

:D
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 5498
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Trigger only when event is detected 'x' times in 'y' seconds

Post by kgschlosser » Wed Jan 24, 2018 1:54 pm

Update on this issue.

I know that it has been asked for sever times. And I have a raw prototype. But it generates events on audio detection. I am going to have to purchase a mic to see if it works with an input as well. But i am thinking it should. But this gives me notifications if audio starts and stops playing for the output.


I am in the process of exposing an extremely large portion of Windows Core Audio.
Here is some of the output that I am able to generate.

Code: Select all



device name: 3- High Definition Audio Device
=======================================================
    id: {0.0.0.00000000}.{0197b327-4a90-42b9-8876-b729cae89d3d}
    connector count: 1
    state: Not Present

    endpoint name: Digital Audio (HDMI) (3- High Definition Audio Device)
    ---------------------------------------------------
        description: Digital Audio (HDMI)
        data flow: Render
        form factor: Digital Audio Display Device
        type: Digital Audio Display Device
        full range speakers: None
        guid: {0197B327-4A90-42B9-8876-B729CAE89D3D}
        physical speakers: None
        system effects: False
        sessions

    endpoint name: Internal AUX Jack (3- High Definition Audio Device)
    ---------------------------------------------------
        description: Internal AUX Jack
        data flow: Capture
        form factor: Unknown Form Factor
        type: Unknown Form Factor
        full range speakers: None
        guid: {F15426D2-CAC3-498B-8D44-D27D5E6460B9}
        physical speakers: None
        system effects: False
        sessions



device name: 4- High Definition Audio Device
=======================================================
    id: {0.0.0.00000000}.{16da76fa-e09a-4606-b8b4-a89211fd5d30}
    connector count: 1
    state: Not Present

    endpoint name: Internal AUX Jack (4- High Definition Audio Device)
    ---------------------------------------------------
        description: Internal AUX Jack
        data flow: Render
        form factor: Unknown Form Factor
        type: Unknown Form Factor
        full range speakers: None
        guid: {16DA76FA-E09A-4606-B8B4-A89211FD5D30}
        physical speakers: None
        system effects: False
        sessions

    endpoint name: Speakers (4- High Definition Audio Device)
    ---------------------------------------------------
        description: Speakers
        data flow: Render
        form factor: Speakers
        type: Speakers
        full range speakers: None
        guid: {EBD57F0D-F2EA-40C5-852D-8D183CC84EA1}
        physical speakers: None
        system effects: False
        sessions
            session 0
                name: System Sounds
                id: {0.0.0.00000000}.{ebd57f0d-f2ea-40c5-852d-8d183cc84ea1}|#%b{A9EF3FD9-4240-455E-A4D5-F2B3301887B2}
                instance id: {0.0.0.00000000}.{ebd57f0d-f2ea-40c5-852d-8d183cc84ea1}|#%b{A9EF3FD9-4240-455E-A4D5-F2B3301887B2}|1%b#
                process id: 0
                is system sounds: True
                grouping param: {1C60ABA8-F623-4B7A-88C7-102EA44B9EA5}
                icon path: @%SystemRoot%\System32\AudioSrv.Dll,-203
                state: Inactive

    endpoint name: Microphone (4- High Definition Audio Device)
    ---------------------------------------------------
        description: Microphone
        data flow: Capture
        form factor: Microphone
        type: Microphone
        full range speakers: None
        guid: {EBB9CCDF-A1BE-4C7E-8F3F-20F90E4082E7}
        physical speakers: None
        system effects: False
        sessions

    endpoint name: Microphone (4- High Definition Audio Device)
    ---------------------------------------------------
        description: Microphone
        data flow: Capture
        form factor: Microphone
        type: Microphone
        full range speakers: None
        guid: {F8862BD3-C384-4695-BE5C-2480267C4C4E}
        physical speakers: None
        system effects: False
        sessions



device name: AMD High Definition Audio Device
=======================================================
    id: {0.0.0.00000000}.{7ba1bedc-1204-4194-a80c-30e7217a4dbc}
    connector count: 1
    state: Unplugged

    endpoint name: 1 - Digital Display Audio (AMD High Definition Audio Device)
    ---------------------------------------------------
        description: 1 - Digital Display Audio
        data flow: Render
        form factor: Digital Audio Display Device
        type: Digital Audio Display Device
        full range speakers: None
        guid: {7BA1BEDC-1204-4194-A80C-30E7217A4DBC}
        physical speakers: None
        system effects: False
        manufacturer id: 0
        product id: 0
        audio latency: 0
        hdcp capable: False
        ai capable: False
        description: 
        connection type: HDMI
        sessions

        connectors
            0:
                channel mapping: Direct
                color: (0, 0, 0)
                type: Generic digital connector
                location: On separate chassis, HDMI connector
                port: Jack
                presence detection: True
                dynamic format change: True
                is connected: False

    endpoint name: 4 - Digital Display Audio (AMD High Definition Audio Device)
    ---------------------------------------------------
        description: 4 - Digital Display Audio
        data flow: Render
        form factor: Digital Audio Display Device
        type: Digital Audio Display Device
        full range speakers: None
        guid: {BE2582EF-CAF5-4AF1-BFDA-754601E2E97D}
        physical speakers: None
        system effects: False
        manufacturer id: 0
        product id: 0
        audio latency: 0
        hdcp capable: False
        ai capable: False
        description: 
        connection type: HDMI
        sessions

        connectors
            0:
                channel mapping: Direct
                color: (0, 0, 0)
                type: Generic digital connector
                location: On separate chassis, HDMI connector
                port: Jack
                presence detection: True
                dynamic format change: True
                is connected: False

    endpoint name: 3 - Digital Display Audio (AMD High Definition Audio Device)
    ---------------------------------------------------
        description: 3 - Digital Display Audio
        data flow: Render
        form factor: Digital Audio Display Device
        type: Digital Audio Display Device
        full range speakers: None
        guid: {D81CF633-E26B-4C27-9F92-3E10BB58CE95}
        physical speakers: None
        system effects: False
        manufacturer id: 0
        product id: 0
        audio latency: 0
        hdcp capable: False
        ai capable: False
        description: 
        connection type: HDMI
        sessions

        connectors
            0:
                channel mapping: Direct
                color: (0, 0, 0)
                type: Generic digital connector
                location: On separate chassis, HDMI connector
                port: Jack
                presence detection: True
                dynamic format change: True
                is connected: False

    endpoint name: 6 - Digital Display Audio (AMD High Definition Audio Device)
    ---------------------------------------------------
        description: 6 - Digital Display Audio
        data flow: Render
        form factor: Digital Audio Display Device
        type: Digital Audio Display Device
        full range speakers: None
        guid: {DCF360BE-9E92-423E-B37D-8112ABDB0AAA}
        physical speakers: None
        system effects: False
        manufacturer id: 0
        product id: 0
        audio latency: 0
        hdcp capable: False
        ai capable: False
        description: 
        connection type: HDMI
        sessions

        connectors
            0:
                channel mapping: Direct
                color: (0, 0, 0)
                type: Generic digital connector
                location: On separate chassis, HDMI connector
                port: Jack
                presence detection: True
                dynamic format change: True
                is connected: False

    endpoint name: 5 - Digital Display Audio (AMD High Definition Audio Device)
    ---------------------------------------------------
        description: 5 - Digital Display Audio
        data flow: Render
        form factor: Digital Audio Display Device
        type: Digital Audio Display Device
        full range speakers: None
        guid: {E8CB1D4B-D752-411E-A872-792EDBE5CE40}
        physical speakers: None
        system effects: False
        manufacturer id: 0
        product id: 0
        audio latency: 0
        hdcp capable: False
        ai capable: False
        description: 
        connection type: HDMI
        sessions

        connectors
            0:
                channel mapping: Direct
                color: (0, 0, 0)
                type: Generic digital connector
                location: On separate chassis, HDMI connector
                port: Jack
                presence detection: True
                dynamic format change: True
                is connected: False

    endpoint name: 2 - Digital Display Audio (AMD High Definition Audio Device)
    ---------------------------------------------------
        description: 2 - Digital Display Audio
        data flow: Render
        form factor: Digital Audio Display Device
        type: Digital Audio Display Device
        full range speakers: None
        guid: {FF622C46-C86D-409D-A59A-DEB74D628B1B}
        physical speakers: None
        system effects: False
        manufacturer id: 0
        product id: 0
        audio latency: 0
        hdcp capable: False
        ai capable: False
        description: 
        connection type: HDMI
        sessions

        connectors
            0:
                channel mapping: Direct
                color: (0, 0, 0)
                type: Generic digital connector
                location: On separate chassis, HDMI connector
                port: Jack
                presence detection: True
                dynamic format change: True
                is connected: False

    endpoint name: Internal AUX Jack (AMD High Definition Audio Device)
    ---------------------------------------------------
        description: Internal AUX Jack
        data flow: Capture
        form factor: Unknown Form Factor
        type: Unknown Form Factor
        full range speakers: None
        guid: {0DFD5777-65F3-4340-A06B-5C455FD6C36B}
        physical speakers: None
        system effects: False
        sessions

    endpoint name: Internal AUX Jack (AMD High Definition Audio Device)
    ---------------------------------------------------
        description: Internal AUX Jack
        data flow: Capture
        form factor: Unknown Form Factor
        type: Unknown Form Factor
        full range speakers: None
        guid: {3B0EADD6-ECDF-4A60-95A6-8CCB1E74D48F}
        physical speakers: None
        system effects: False
        sessions

    endpoint name: Internal AUX Jack (AMD High Definition Audio Device)
    ---------------------------------------------------
        description: Internal AUX Jack
        data flow: Capture
        form factor: Unknown Form Factor
        type: Unknown Form Factor
        full range speakers: None
        guid: {419BC1CA-C9B7-49E7-B14A-0FCC75B421CA}
        physical speakers: None
        system effects: False
        sessions

    endpoint name: Internal AUX Jack (AMD High Definition Audio Device)
    ---------------------------------------------------
        description: Internal AUX Jack
        data flow: Capture
        form factor: Unknown Form Factor
        type: Unknown Form Factor
        full range speakers: None
        guid: {5F201E20-71CE-4D59-86FD-B9207B53CA3D}
        physical speakers: None
        system effects: False
        sessions

    endpoint name: Internal AUX Jack (AMD High Definition Audio Device)
    ---------------------------------------------------
        description: Internal AUX Jack
        data flow: Capture
        form factor: Unknown Form Factor
        type: Unknown Form Factor
        full range speakers: None
        guid: {8C0DEE55-E75B-4563-87B4-EB30E7B96116}
        physical speakers: None
        system effects: False
        sessions

    endpoint name: Internal AUX Jack (AMD High Definition Audio Device)
    ---------------------------------------------------
        description: Internal AUX Jack
        data flow: Capture
        form factor: Unknown Form Factor
        type: Unknown Form Factor
        full range speakers: None
        guid: {E6A9B1B8-CDA1-4AD7-976C-8AAB590699E9}
        physical speakers: None
        system effects: False
        sessions



device name: High Definition Audio Device
=======================================================
    id: {0.0.0.00000000}.{9214d432-217c-4ca5-975a-821b8468a52c}
    connector count: 1
    state: Not Present

    endpoint name: Internal AUX Jack (High Definition Audio Device)
    ---------------------------------------------------
        description: Internal AUX Jack
        data flow: Render
        form factor: Unknown Form Factor
        type: Unknown Form Factor
        full range speakers: None
        guid: {9214D432-217C-4CA5-975A-821B8468A52C}
        physical speakers: None
        system effects: False
        sessions

    endpoint name: Speakers (High Definition Audio Device)
    ---------------------------------------------------
        description: Speakers
        data flow: Render
        form factor: Speakers
        type: Speakers
        full range speakers: None
        guid: {B85EE71E-1C6C-419D-8E60-BFCD27406933}
        physical speakers: None
        system effects: False
        sessions
            session 0
                name: System Sounds
                id: {0.0.0.00000000}.{b85ee71e-1c6c-419d-8e60-bfcd27406933}|#%b{A9EF3FD9-4240-455E-A4D5-F2B3301887B2}
                instance id: {0.0.0.00000000}.{b85ee71e-1c6c-419d-8e60-bfcd27406933}|#%b{A9EF3FD9-4240-455E-A4D5-F2B3301887B2}|1%b#
                process id: 0
                is system sounds: True
                grouping param: {D90CC35A-38A8-43B3-8E18-A715ACDA98B0}
                icon path: @%SystemRoot%\System32\AudioSrv.Dll,-203
                state: Inactive

    endpoint name: Microphone (High Definition Audio Device)
    ---------------------------------------------------
        description: Microphone
        data flow: Capture
        form factor: Microphone
        type: Microphone
        full range speakers: None
        guid: {0140180D-956C-4119-9383-405C594D3308}
        physical speakers: None
        system effects: False
        sessions

    endpoint name: Microphone (High Definition Audio Device)
    ---------------------------------------------------
        description: Microphone
        data flow: Capture
        form factor: Microphone
        type: Microphone
        full range speakers: None
        guid: {05EA3C96-67AB-41E9-90C3-0365435DA23C}
        physical speakers: None
        system effects: False
        sessions



device name: 2- High Definition Audio Device
=======================================================
    id: {0.0.0.00000000}.{be09f0d7-178b-477e-a395-ae9dfaeca211}
    connector count: 1
    state: Not Present

    endpoint name: Digital Audio (HDMI) (2- High Definition Audio Device)
    ---------------------------------------------------
        description: Digital Audio (HDMI)
        data flow: Render
        form factor: Digital Audio Display Device
        type: Digital Audio Display Device
        full range speakers: None
        guid: {BE09F0D7-178B-477E-A395-AE9DFAECA211}
        physical speakers: None
        system effects: False
        sessions

    endpoint name: Internal AUX Jack (2- High Definition Audio Device)
    ---------------------------------------------------
        description: Internal AUX Jack
        data flow: Capture
        form factor: Unknown Form Factor
        type: Unknown Form Factor
        full range speakers: None
        guid: {2FD08377-7884-4E0F-960B-D50CF74D557B}
        physical speakers: None
        system effects: False
        sessions



device name: Realtek High Definition Audio
=======================================================
    id: {0.0.0.00000000}.{f28eb0f1-c681-49f2-8e8d-758e2d0bdd08}
    connector count: 1
    state: Active

    endpoint name: Speakers (Realtek High Definition Audio)
    ---------------------------------------------------
        description: Speakers
        data flow: Render
        form factor: Speakers
        type: Speakers
        full range speakers: Stereo
        guid: {F28EB0F1-C681-49F2-8E8D-758E2D0BDD08}
        physical speakers: Stereo
        system effects: False
        sessions
            session 0
                name: System Sounds
                id: {0.0.0.00000000}.{f28eb0f1-c681-49f2-8e8d-758e2d0bdd08}|#%b{A9EF3FD9-4240-455E-A4D5-F2B3301887B2}
                instance id: {0.0.0.00000000}.{f28eb0f1-c681-49f2-8e8d-758e2d0bdd08}|#%b{A9EF3FD9-4240-455E-A4D5-F2B3301887B2}|1%b#
                process id: 0
                is system sounds: True
                grouping param: {A1D83A1B-79A3-4132-9C46-18C27479556B}
                icon path: @%SystemRoot%\System32\AudioSrv.Dll,-203
                state: Inactive
            session 1
                name: Mozilla Firefox
                id: {0.0.0.00000000}.{f28eb0f1-c681-49f2-8e8d-758e2d0bdd08}|\Device\HarddiskVolume2\Program Files (x86)\Mozilla Firefox\firefox.exe%b{00000000-0000-0000-0000-000000000000}
                instance id: {0.0.0.00000000}.{f28eb0f1-c681-49f2-8e8d-758e2d0bdd08}|\Device\HarddiskVolume2\Program Files (x86)\Mozilla Firefox\firefox.exe%b{00000000-0000-0000-0000-000000000000}|1%b5820
                process id: 5820
                is system sounds: False
                grouping param: {F14AE922-AC0B-49B1-933B-BAC48AE21AB9}
                icon path: C:\Program Files (x86)\Mozilla Firefox\firefox.exe
                state: Inactive

        connectors
            0:
                channel mapping: Stereo
                color: (0, 255, 0)
                type: 3.5mm (1\8" Headphone) jack
                location: On primary chassis, Rear-mounted panel
                port: Jack
                presence detection: True
                dynamic format change: False
                is connected: True

        volume
            master level: -17.308380127
            master level scalar: 0.309999972582
            master min: -64.0
            master max: 0.0
            master step: 0.03125
            mute: False
            channel count: 2

            channel levels
                0:
                    level: -17.308380127
                    scalar level: 0.309999972582
                    min: -64.0
                    max: 0.0
                    step: 0.03125
                1:
                    level: -17.308380127
                    scalar level: 0.309999972582
                    min: -64.0
                    max: 0.0
                    step: 0.03125

            peak meter
                master: 0.0
                channels
                    0:
                        level: 0.0
                    1:
                        level: 0.0

    endpoint name: Microphone (Realtek High Definition Audio)
    ---------------------------------------------------
        description: Microphone
        data flow: Capture
        form factor: Microphone
        type: Microphone
        full range speakers: None
        guid: {121394C7-24B4-46C0-AAF5-CAB079B0B42D}
        physical speakers: None
        system effects: False
        sessions
            session 0
                name: System Sounds
                id: {0.0.1.00000000}.{121394c7-24b4-46c0-aaf5-cab079b0b42d}|#%b{A9EF3FD9-4240-455E-A4D5-F2B3301887B2}
                instance id: {0.0.1.00000000}.{121394c7-24b4-46c0-aaf5-cab079b0b42d}|#%b{A9EF3FD9-4240-455E-A4D5-F2B3301887B2}|1%b#
                process id: 0
                is system sounds: True
                grouping param: {B8C78C35-F2BA-433C-B3F9-FCFB9980F087}
                icon path: @%SystemRoot%\System32\AudioSrv.Dll,-203
                state: Inactive
            session 1
                name: 
                id: {0.0.1.00000000}.{121394c7-24b4-46c0-aaf5-cab079b0b42d}|\Device\HarddiskVolume2\Windows\System32\rundll32.exe%b{00000000-0000-0000-0000-000000000000}
                instance id: {0.0.1.00000000}.{121394c7-24b4-46c0-aaf5-cab079b0b42d}|\Device\HarddiskVolume2\Windows\System32\rundll32.exe%b{00000000-0000-0000-0000-000000000000}|1%b2080
                process id: 2080
                is system sounds: False
                grouping param: {FE63A5F6-84EA-48BE-BA48-5229CAECC909}
                icon path: 
                state: Active

        connectors
            0:
                channel mapping: Direct
                color: (255, 128, 192)
                type: 3.5mm (1\8" Headphone) jack
                location: On primary chassis, Rear-mounted panel
                port: Jack
                presence detection: True
                dynamic format change: False
                is connected: True

        volume
            master level: 6.63830566406
            master level scalar: 0.159999981523
            master min: -16.0
            master max: 22.0
            master step: 0.03125
            mute: False
            channel count: 2

            channel levels
                0:
                    level: 6.63830566406
                    scalar level: 0.159999981523
                    min: -16.0
                    max: 22.0
                    step: 0.03125
                1:
                    level: 6.6383099556
                    scalar level: 0.160000056028
                    min: -16.0
                    max: 22.0
                    step: 0.03125

            peak meter
                master: 0.00030517578125
                channels
                    0:
                        level: 0.000274658203125
                    1:
                        level: 0.00030517578125

    endpoint name: Front Green In (Realtek High Definition Audio)
    ---------------------------------------------------
        description: Front Green In
        data flow: Capture
        form factor: Unknown Form Factor
        type: Unknown Form Factor
        full range speakers: None
        guid: {1CD685E7-5750-4A10-8CF0-3F591F0DBD2F}
        physical speakers: None
        system effects: False
        sessions

    endpoint name: Side (Realtek High Definition Audio)
    ---------------------------------------------------
        description: Side
        data flow: Capture
        form factor: Unknown Form Factor
        type: Unknown Form Factor
        full range speakers: None
        guid: {36515F81-B034-475A-8110-6681C1C85E6F}
        physical speakers: None
        system effects: False
        sessions

    endpoint name: Rear Green In (Realtek High Definition Audio)
    ---------------------------------------------------
        description: Rear Green In
        data flow: Capture
        form factor: Unknown Form Factor
        type: Unknown Form Factor
        full range speakers: None
        guid: {462C2526-6EB5-46F3-9998-1885DA24581E}
        physical speakers: None
        system effects: False
        sessions

    endpoint name: Rear (Realtek High Definition Audio)
    ---------------------------------------------------
        description: Rear
        data flow: Capture
        form factor: Unknown Form Factor
        type: Unknown Form Factor
        full range speakers: None
        guid: {4E6C6D7F-9C13-441E-9188-7686D155763D}
        physical speakers: None
        system effects: False
        sessions

    endpoint name: Center (Realtek High Definition Audio)
    ---------------------------------------------------
        description: Center
        data flow: Capture
        form factor: Unknown Form Factor
        type: Unknown Form Factor
        full range speakers: None
        guid: {5D36A341-6E5E-46BA-889E-43E9C425DB8B}
        physical speakers: None
        system effects: False
        sessions

    endpoint name: Front Pink In (Realtek High Definition Audio)
    ---------------------------------------------------
        description: Front Pink In
        data flow: Capture
        form factor: Unknown Form Factor
        type: Unknown Form Factor
        full range speakers: None
        guid: {5DDD594E-5CA2-4D86-ABB0-D7F2ABBBC8E3}
        physical speakers: None
        system effects: False
        sessions

    endpoint name: Front (Realtek High Definition Audio)
    ---------------------------------------------------
        description: Front
        data flow: Capture
        form factor: Unknown Form Factor
        type: Unknown Form Factor
        full range speakers: None
        guid: {60C1F447-71B8-49A3-B342-CA831DF5E89E}
        physical speakers: None
        system effects: False
        sessions

    endpoint name: Rear Blue In (Realtek High Definition Audio)
    ---------------------------------------------------
        description: Rear Blue In
        data flow: Capture
        form factor: Unknown Form Factor
        type: Unknown Form Factor
        full range speakers: None
        guid: {842CE455-E17B-4609-9116-B772540D8CCA}
        physical speakers: None
        system effects: False
        sessions

    endpoint name: Stereo Mix (Realtek High Definition Audio)
    ---------------------------------------------------
        description: Stereo Mix
        data flow: Capture
        form factor: Unknown Form Factor
        type: Unknown Form Factor
        full range speakers: None
        guid: {89A69B85-2AD5-40BE-A62D-C51C7FC40201}
        physical speakers: None
        system effects: False
        sessions
            session 0
                name: System Sounds
                id: {0.0.1.00000000}.{89a69b85-2ad5-40be-a62d-c51c7fc40201}|#%b{A9EF3FD9-4240-455E-A4D5-F2B3301887B2}
                instance id: {0.0.1.00000000}.{89a69b85-2ad5-40be-a62d-c51c7fc40201}|#%b{A9EF3FD9-4240-455E-A4D5-F2B3301887B2}|1%b#
                process id: 0
                is system sounds: True
                grouping param: {4D2736BF-576B-48C6-8FB6-C031AFBDEC53}
                icon path: @%SystemRoot%\System32\AudioSrv.Dll,-203
                state: Inactive
            session 1
                name: 
                id: {0.0.1.00000000}.{89a69b85-2ad5-40be-a62d-c51c7fc40201}|\Device\HarddiskVolume2\Windows\System32\rundll32.exe%b{00000000-0000-0000-0000-000000000000}
                instance id: {0.0.1.00000000}.{89a69b85-2ad5-40be-a62d-c51c7fc40201}|\Device\HarddiskVolume2\Windows\System32\rundll32.exe%b{00000000-0000-0000-0000-000000000000}|1%b2080
                process id: 2080
                is system sounds: False
                grouping param: {1BEDDEB1-DD59-4065-A564-4C44AA5A9FB5}
                icon path: 
                state: Active

        connectors
            0:
                channel mapping: Direct
                color: (0, 0, 0)
                type: Unknown
                location: On primary chassis, Not Applicable
                port: Slot for an integrated device
                presence detection: False
                dynamic format change: False
                is connected: True

        volume
            master level: 10.649187088
            master level scalar: 0.850000023842
            master min: -16.0
            master max: 12.0
            master step: 0.03125
            mute: False
            channel count: 2

            channel levels
                0:
                    level: 10.649187088
                    scalar level: 0.850000023842
                    min: -16.0
                    max: 12.0
                    step: 0.03125
                1:
                    level: 10.649189949
                    scalar level: 0.85000026226
                    min: -16.0
                    max: 12.0
                    step: 0.03125

            peak meter
                master: 0.000518798828125
                channels
                    0:
                        level: 0.000518798828125
                    1:
                        level: 0.0003662109375

    endpoint name: Rear Pink In (Realtek High Definition Audio)
    ---------------------------------------------------
        description: Rear Pink In
        data flow: Capture
        form factor: Unknown Form Factor
        type: Unknown Form Factor
        full range speakers: None
        guid: {CB680BE4-A3FA-4D3A-A17C-A71D73CFC7AB}
        physical speakers: None
        system effects: False
        sessions

    endpoint name: Line In (Realtek High Definition Audio)
    ---------------------------------------------------
        description: Line In
        data flow: Capture
        form factor: Line Level
        type: Line Level
        full range speakers: None
        guid: {F7E33FF9-EB44-48D9-9C40-8AC7E9AD5C3C}
        physical speakers: None
        system effects: False
        sessions
            session 0
                name: System Sounds
                id: {0.0.1.00000000}.{f7e33ff9-eb44-48d9-9c40-8ac7e9ad5c3c}|#%b{A9EF3FD9-4240-455E-A4D5-F2B3301887B2}
                instance id: {0.0.1.00000000}.{f7e33ff9-eb44-48d9-9c40-8ac7e9ad5c3c}|#%b{A9EF3FD9-4240-455E-A4D5-F2B3301887B2}|1%b#
                process id: 0
                is system sounds: True
                grouping param: {AE5E4CE6-BB18-4AA9-97F8-F6A17A5FC39E}
                icon path: @%SystemRoot%\System32\AudioSrv.Dll,-203
                state: Inactive

        connectors
            0:
                channel mapping: Direct
                color: (0, 255, 0)
                type: 3.5mm (1\8" Headphone) jack
                location: On primary chassis, Rear-mounted panel
                port: Jack
                presence detection: True
                dynamic format change: False
                is connected: False

        volume
            master level: 0.0
            master level scalar: 0.0676958039403
            master min: -16.0
            master max: 22.0
            master step: 0.03125
            mute: False
            channel count: 2

            channel levels
                0:
                    level: 0.0
                    scalar level: 0.0676958039403
                    min: -16.0
                    max: 22.0
                    step: 0.03125
                1:
                    level: 0.0
                    scalar level: 0.0676958039403
                    min: -16.0
                    max: 22.0
                    step: 0.03125

            peak meter
                master: 0.0
                channels
                    0:
                        level: 0.0
                    1:
                        level: 0.0

    endpoint name: Subwoofer (Realtek High Definition Audio)
    ---------------------------------------------------
        description: Subwoofer
        data flow: Capture
        form factor: Unknown Form Factor
        type: Unknown Form Factor
        full range speakers: None
        guid: {F87C58FB-46F1-4BBC-9716-3B0CF8AF2AF9}
        physical speakers: None
        system effects: False
        sessions



device name: 2- Microsoft LifeCam VX-6000.
=======================================================
    id: {0.0.1.00000000}.{0ec31cc9-b308-44cd-8ed9-e535287a4ec8}
    connector count: 1
    state: Not Present

    endpoint name: Microphone (2- Microsoft LifeCam VX-6000.)
    ---------------------------------------------------
        description: Microphone
        data flow: Capture
        form factor: Microphone
        type: Microphone
        full range speakers: None
        guid: {0EC31CC9-B308-44CD-8ED9-E535287A4EC8}
        physical speakers: None
        system effects: False
        sessions
            session 0
                name: System Sounds
                id: {0.0.1.00000000}.{0ec31cc9-b308-44cd-8ed9-e535287a4ec8}|#%b{A9EF3FD9-4240-455E-A4D5-F2B3301887B2}
                instance id: {0.0.1.00000000}.{0ec31cc9-b308-44cd-8ed9-e535287a4ec8}|#%b{A9EF3FD9-4240-455E-A4D5-F2B3301887B2}|1%b#
                process id: 0
                is system sounds: True
                grouping param: {8AABAAFF-A901-4384-9979-116B7015D487}
                icon path: @%SystemRoot%\System32\AudioSrv.Dll,-203
                state: Inactive



device name: Microsoft LifeCam VX-6000.
=======================================================
    id: {0.0.1.00000000}.{de8a4514-9e27-4bb9-9a90-9c340ae97d98}
    connector count: 1
    state: Not Present

    endpoint name: Microphone (Microsoft LifeCam VX-6000.)
    ---------------------------------------------------
        description: Microphone
        data flow: Capture
        form factor: Microphone
        type: Microphone
        full range speakers: None
        guid: {DE8A4514-9E27-4BB9-9A90-9C340AE97D98}
        physical speakers: None
        system effects: False
        sessions
            session 0
                name: System Sounds
                id: {0.0.1.00000000}.{de8a4514-9e27-4bb9-9a90-9c340ae97d98}|#%b{A9EF3FD9-4240-455E-A4D5-F2B3301887B2}
                instance id: {0.0.1.00000000}.{de8a4514-9e27-4bb9-9a90-9c340ae97d98}|#%b{A9EF3FD9-4240-455E-A4D5-F2B3301887B2}|1%b#
                process id: 0
                is system sounds: True
                grouping param: {74A0BF62-4D14-4FC8-83E9-0E6D0D9A615F}
                icon path: @%SystemRoot%\System32\AudioSrv.Dll,-203
                state: Inactive


default render device: Realtek High Definition Audio
default render endpoint: Speakers (Realtek High Definition Audio)
default render endpoint volume: 30.9999972582%
default capture device: Realtek High Definition Audio
default capture endpoint: Microphone (Realtek High Definition Audio)
default capture endpoint volume: 15.9999981523%


Change the volume.
Set the mute.
Change the default device.
Change some of the device properties.

Press any key to exit.
default endpoint changed
    device name: Realtek High Definition Audio
    endpoint name: Stereo Mix (Realtek High Definition Audio)


default endpoint changed
    device name: Realtek High Definition Audio
    endpoint name: Stereo Mix (Realtek High Definition Audio)


audio session state changed
    device name: Realtek High Definition Audio
    endpoint name: Stereo Mix (Realtek High Definition Audio)
    name: 
    id: {0.0.1.00000000}.{89a69b85-2ad5-40be-a62d-c51c7fc40201}|\Device\HarddiskVolume2\Windows\System32\rundll32.exe%b{00000000-0000-0000-0000-000000000000}
    instance id: {0.0.1.00000000}.{89a69b85-2ad5-40be-a62d-c51c7fc40201}|\Device\HarddiskVolume2\Windows\System32\rundll32.exe%b{00000000-0000-0000-0000-000000000000}|1%b2080
    process id: 2080
    is system sounds: False
    state: Inactive


audio session state changed
    device name: Realtek High Definition Audio
    endpoint name: Microphone (Realtek High Definition Audio)
    name: 
    id: {0.0.1.00000000}.{121394c7-24b4-46c0-aaf5-cab079b0b42d}|\Device\HarddiskVolume2\Windows\System32\rundll32.exe%b{00000000-0000-0000-0000-000000000000}
    instance id: {0.0.1.00000000}.{121394c7-24b4-46c0-aaf5-cab079b0b42d}|\Device\HarddiskVolume2\Windows\System32\rundll32.exe%b{00000000-0000-0000-0000-000000000000}|1%b2080
    process id: 2080
    is system sounds: False
    state: Inactive


audio session state changed
    device name: Realtek High Definition Audio
    endpoint name: Stereo Mix (Realtek High Definition Audio)
    name: 
    id: {0.0.1.00000000}.{89a69b85-2ad5-40be-a62d-c51c7fc40201}|\Device\HarddiskVolume2\Windows\System32\rundll32.exe%b{00000000-0000-0000-0000-000000000000}
    instance id: {0.0.1.00000000}.{89a69b85-2ad5-40be-a62d-c51c7fc40201}|\Device\HarddiskVolume2\Windows\System32\rundll32.exe%b{00000000-0000-0000-0000-000000000000}|1%b2080
    process id: 2080
    is system sounds: False
    state: Active


audio session state changed
    device name: Realtek High Definition Audio
    endpoint name: Microphone (Realtek High Definition Audio)
    name: 
    id: {0.0.1.00000000}.{121394c7-24b4-46c0-aaf5-cab079b0b42d}|\Device\HarddiskVolume2\Windows\System32\rundll32.exe%b{00000000-0000-0000-0000-000000000000}
    instance id: {0.0.1.00000000}.{121394c7-24b4-46c0-aaf5-cab079b0b42d}|\Device\HarddiskVolume2\Windows\System32\rundll32.exe%b{00000000-0000-0000-0000-000000000000}|1%b2080
    process id: 2080
    is system sounds: False
    state: Active


endpoint volume change
    device name: Realtek High Definition Audio
    endpoint name: Speakers (Realtek High Definition Audio)
    master: 50.9999990463%
    mute: False
    channel 0 level: 50.9999990463%
    channel 1 level: 50.9999990463%


audio session state changed
    device name: Realtek High Definition Audio
    endpoint name: Speakers (Realtek High Definition Audio)
    name: System Sounds
    id: {0.0.0.00000000}.{f28eb0f1-c681-49f2-8e8d-758e2d0bdd08}|#%b{A9EF3FD9-4240-455E-A4D5-F2B3301887B2}
    instance id: {0.0.0.00000000}.{f28eb0f1-c681-49f2-8e8d-758e2d0bdd08}|#%b{A9EF3FD9-4240-455E-A4D5-F2B3301887B2}|1%b#
    process id: 0
    is system sounds: True
    state: Active


audio session state changed
    device name: Realtek High Definition Audio
    endpoint name: Speakers (Realtek High Definition Audio)
    name: System Sounds
    id: {0.0.0.00000000}.{f28eb0f1-c681-49f2-8e8d-758e2d0bdd08}|#%b{A9EF3FD9-4240-455E-A4D5-F2B3301887B2}
    instance id: {0.0.0.00000000}.{f28eb0f1-c681-49f2-8e8d-758e2d0bdd08}|#%b{A9EF3FD9-4240-455E-A4D5-F2B3301887B2}|1%b#
    process id: 0
    is system sounds: True
    state: Inactive

the audio session state changes are the ones when the sound output changes
If you like the work I have been doing then feel free to Image

holdestmade
Experienced User
Posts: 183
Joined: Thu Dec 04, 2014 2:44 pm

Re: Trigger only when event is detected 'x' times in 'y' seconds

Post by holdestmade » Wed Jan 24, 2018 5:26 pm

Sounds interesting, and I have a use for it. Been looking for a way to Mute my TV/Receiver when Alexa is speaking (I have Alexa plugged into the line in in my HA PC/Server and mixed with EG playing recorded Alexa announcements so they come from the same place, ie a speaker plugged into my HA PC/Server, if that makes sense)

I do mute the TV / receiver when EG plays the recorded sounds and that is working fine

If sound is detected on my line in I can send a mute command from EG to RTI to mute my TV or receiver.

User avatar
kgschlosser
Site Admin
Posts: 5498
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Trigger only when event is detected 'x' times in 'y' seconds

Post by kgschlosser » Wed Jan 24, 2018 9:20 pm

yup this indeed would work for you.
If you like the work I have been doing then feel free to Image

Post Reply