dsh-reminder-notify 0.10.1 → 0.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/host/ReminderHost.ps1 +0 -26
- package/package.json +1 -1
- package/publish/index.json +2 -2
package/host/ReminderHost.ps1
CHANGED
|
@@ -24,7 +24,6 @@ param(
|
|
|
24
24
|
[string]$Accent = '#2ECC71',
|
|
25
25
|
[string]$Background = '',
|
|
26
26
|
[string]$Icon = '',
|
|
27
|
-
[string]$Speak = '',
|
|
28
27
|
[switch]$NoSound,
|
|
29
28
|
[switch]$Preview,
|
|
30
29
|
[string]$Log = ''
|
|
@@ -318,30 +317,6 @@ if (-not $NoSound -and -not [string]::IsNullOrEmpty($Audio) -and (Test-Path -Lit
|
|
|
318
317
|
}
|
|
319
318
|
}
|
|
320
319
|
|
|
321
|
-
# ---- 语音朗读(System.Speech,优先中文音色) ---------------------------------
|
|
322
|
-
# 和 -Audio 互不冲突:有提示音就放提示音,同时朗读 -Speak 的文本。
|
|
323
|
-
# 朗读是异步的(SpeakAsync),不拖慢卡片弹出;读不完就随进程退出被掐断。
|
|
324
|
-
$script:synth = $null
|
|
325
|
-
if (-not [string]::IsNullOrEmpty($Speak)) {
|
|
326
|
-
try {
|
|
327
|
-
Add-Type -AssemblyName System.Speech
|
|
328
|
-
$script:synth = New-Object System.Speech.Synthesis.SpeechSynthesizer
|
|
329
|
-
try {
|
|
330
|
-
$zh = $script:synth.GetInstalledVoices() |
|
|
331
|
-
Where-Object { $_.VoiceInfo.Culture.Name -like 'zh-*' } |
|
|
332
|
-
Select-Object -First 1
|
|
333
|
-
if ($zh -ne $null) { $script:synth.SelectVoice($zh.VoiceInfo.Name) }
|
|
334
|
-
} catch { }
|
|
335
|
-
$script:synth.Rate = 0
|
|
336
|
-
$script:synth.Volume = 100
|
|
337
|
-
$script:synth.SpeakAsync($Speak) | Out-Null
|
|
338
|
-
Write-Log ('speak ' + $Speak)
|
|
339
|
-
} catch {
|
|
340
|
-
Write-Log ('speak-failed ' + $_.Exception.Message)
|
|
341
|
-
$script:synth = $null
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
|
|
345
320
|
# ---- 试听:只放声音,不弹卡 ----------------------------------------------------
|
|
346
321
|
# 面板里的「试听」按钮走这条分支:播完(或最多 8 秒)就退出,不留窗口。
|
|
347
322
|
if ($Preview) {
|
|
@@ -369,7 +344,6 @@ $timer.Start()
|
|
|
369
344
|
[System.Windows.Forms.Application]::Run()
|
|
370
345
|
|
|
371
346
|
if ($script:player -ne $null) { $script:player.Dispose() }
|
|
372
|
-
if ($script:synth -ne $null) { try { $script:synth.Dispose() } catch { } }
|
|
373
347
|
if ($script:wmp -ne $null) {
|
|
374
348
|
try { $script:wmp.controls.stop(); $script:wmp.close() } catch { }
|
|
375
349
|
try { [void][System.Runtime.InteropServices.Marshal]::ReleaseComObject($script:wmp) } catch { }
|
package/package.json
CHANGED