Add give-reply.ps1

This commit is contained in:
Markus Fleschutz 2021-12-06 15:46:02 +01:00
parent 2d2803ce4e
commit 589ba8e93c
4 changed files with 76 additions and 3 deletions

View File

@ -1,8 +1,22 @@
Abbreviation,Definition
A/A,Air to air TACAN function
A/C,Aircraft
A/D,Aerodrome
A/F,Autofeather
A/FD,Airport/Facility Directory
A/P,Autopilot
AAE,Above Aerodrome Elevation
AAIB,Air Accidents Investigation Branch (UK)
AAIM,Aircraft Autonomous Integrity Monitoring
AAO,Assumed Adverse Obstacle
AAS,Airport Advisory Service
AB,Air Base
AC,Aircraft
AC,Air Conditioning
ACAM,Aircraft Continuing Airworthiness Monitoring
ACARS,ARINC Communications Addressing and Reporting System
ACAS,Airborne Collision Avoidance System
ACC,Area Control Centre
ACC,Area Control Center
ADAC,Abu Dhabi Airports
ADP,Aeroportes de Paris
AENA,Aeropuertos Españoles y Navegación Aérea
@ -19,6 +33,11 @@ AFM,Airplane Flight Manual
AGL,Above Ground Level
AIP,Aeronautical Information Publication
ANSP,Air Navigation Service Provider
AR,Aerial Refueling
AR,Aspect Ratio
A/R,Altitude Rate
ARFOR,Area Forecast
ARINC,Aeronautical Radio Incorporated (USA)
ARTCC,Air Route Traffic Control Centre
ASB,Airspace Block
ATA,Actual Time of Arrival

1 Abbreviation Definition
2 A/A Air to air TACAN function
3 A/C Aircraft
4 A/D Aerodrome
5 A/F Autofeather
6 A/FD Airport/Facility Directory
7 A/P Autopilot
8 AAE Above Aerodrome Elevation
9 AAIB Air Accidents Investigation Branch (UK)
10 AAIM Aircraft Autonomous Integrity Monitoring
11 AAO Assumed Adverse Obstacle
12 AAS Airport Advisory Service
13 AB Air Base
14 AC Aircraft
15 AC Air Conditioning
16 ACAM Aircraft Continuing Airworthiness Monitoring
17 ACARS ARINC Communications Addressing and Reporting System
18 ACAS Airborne Collision Avoidance System
19 ACC Area Control Centre Area Control Center
20 ADAC Abu Dhabi Airports
21 ADP Aeroportes de Paris
22 AENA Aeropuertos Españoles y Navegación Aérea
33 AGL Above Ground Level
34 AIP Aeronautical Information Publication
35 ANSP Air Navigation Service Provider
36 AR Aerial Refueling
37 AR Aspect Ratio
38 A/R Altitude Rate
39 ARFOR Area Forecast
40 ARINC Aeronautical Radio Incorporated (USA)
41 ARTCC Air Route Traffic Control Centre
42 ASB Airspace Block
43 ATA Actual Time of Arrival

View File

@ -103,9 +103,10 @@ Lets the computer check something, replace [name] by: `Bitcoin`, `Christmas`, `C
* `Computer, tell quote`
💬 Conversation Commands
-------------------------
💬 Welcome & Farewell
---------------------
* `Computer, Hi`
* `Computer, say hello`
* `Computer, good morning`
* `Computer, good evening`
* `Computer, good night`

33
Scripts/give-reply.ps1 Normal file
View File

@ -0,0 +1,33 @@
<#
.SYNOPSIS
Gives a reply
.DESCRIPTION
This script gives a reply in English by text-to-speech (TTS).
.PARAMETER text
Specifies the text to speak
.EXAMPLE
PS> ./give-reply "Hello World"
.NOTES
Author: Markus Fleschutz · License: CC0
.LINK
https://github.com/fleschutz/PowerShell
#>
param([string]$text = "")
try {
"📣$text"
$TTSVoice = New-Object -ComObject SAPI.SPVoice
foreach ($Voice in $TTSVoice.GetVoices()) {
if ($Voice.GetDescription() -like "*- English*") {
$TTSVoice.Voice = $Voice
[void]$TTSVoice.Speak($text)
exit 0 # success
}
}
exit 0 # success
} catch {
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1
}

20
Scripts/say-hello.ps1 Normal file
View File

@ -0,0 +1,20 @@
<#
.SYNOPSIS
Replies to "Say hello"
.DESCRIPTION
This script replies to "Say hello" by text-to-speech (TTS).
.EXAMPLE
PS> ./say-hello
.NOTES
Author: Markus Fleschutz · License: CC0
.LINK
https://github.com/fleschutz/PowerShell
#>
try {
& "$PSScriptRoot/give-reply.ps1" "Hello, everyone."
exit 0 # success
} catch {
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1
}