Files
reader/server/tools/media-sample-voice.ps1
hectorqin 73f9eb6e20 feat(media): add isolated media libraries and playback
Support local and OpenList libraries, metadata, independent media navigation, themes, and audio/video playback. Preserve approved v2 prototypes and current documentation; archive superseded review artifacts and keep generated validation output outside version control.
2026-09-27 18:22:51 +08:00

13 lines
533 B
PowerShell

param([Parameter(Mandatory=$true)][string]$Manifest)
$ErrorActionPreference = 'Stop'
Add-Type -AssemblyName System.Speech
$mediaSampleVoice = New-Object System.Speech.Synthesis.SpeechSynthesizer
try {
$mediaSampleVoice.SelectVoice('Microsoft Huihui Desktop')
$mediaSampleVoice.Rate = -1
foreach ($entry in (Get-Content -LiteralPath $Manifest -Raw -Encoding UTF8 | ConvertFrom-Json)) {
$mediaSampleVoice.SetOutputToWaveFile($entry.path)
$mediaSampleVoice.Speak($entry.text)
}
} finally { $mediaSampleVoice.Dispose() }