Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Greetings... Morning,Afternoon & Evening?

If you have a question or need help, this is the place to be.
Post Reply
shaggy79
Experienced User
Posts: 129
Joined: Sun Jul 13, 2014 4:57 pm

Greetings... Morning,Afternoon & Evening?

Post by shaggy79 »

Hi all, :P
I have been looking :shock: all over EG and cant find my answer anywhere...
Is there a way with the 'Speech Plugin' to have my 'PC' Greet me when I turn it on/un-lock. :?:

As in:-
Turn my PC on or un-lock it...
06:00 to 11:59 "Good Morning"
12:00 to 16:59 "Good Afternoon"
17:00 to 22:00 "Good evening"

Cheers Paul. 8)
Dragon470
Experienced User
Posts: 205
Joined: Thu Feb 10, 2011 2:16 am

Re: Greetings... Morning,Afternoon & Evening?

Post by Dragon470 »

Just apply the appropriate events in front of this script.

Code: Select all

from datetime import datetime
current = datetime.now().time()
morning = current.replace(hour=6, minute=0, second=0)
afternoon = current.replace(hour=12, minute=0, second=0)
evening = current.replace(hour=17, minute=0, second=0)
if current > morning:
    if current > afternoon:
        if current > evening:
            eg.plugins.Speech.TextToSpeech(u'Microsoft Anna - English (United States)', 0, u'Good evening', 0, 100)
        else:
            eg.plugins.Speech.TextToSpeech(u'Microsoft Anna - English (United States)', 0, u'Good afternoon', 0, 100)
    else:
        eg.plugins.Speech.TextToSpeech(u'Microsoft Anna - English (United States)', 0, u'Good morning', 0, 100)
shaggy79
Experienced User
Posts: 129
Joined: Sun Jul 13, 2014 4:57 pm

Re: Greetings... Morning,Afternoon & Evening?

Post by shaggy79 »

@ Dragon470, 8)

Thank you VERY Much. :)
Is there a way to change the voice to 'IVONA 2 Brian - British English Voice' :?:
I have tried writing it in the code you gave me but it just says...
"Voice with name IVONA 2 Brian - British English Voice) is not available".
Is there something else I have to change :?:

Cheers Paul. :P
shaggy79
Experienced User
Posts: 129
Joined: Sun Jul 13, 2014 4:57 pm

Re: Greetings... Morning,Afternoon & Evening?

Post by shaggy79 »

:?: :?: :?: :?: :?: :?: :?: :?: :?:

I got the voice I wanted to use working, :) but it still comes up with the same error... :?:
"Voice with name IVONA 2 Brian - British English Voice is not available".
Even though it is using this voice :?:
I have no idea why :?: :idea:
Can anyone tell me please :?:

Cheers Paul. :shock:
Post Reply