Complete Jessica voiceover for Katya and build DoOtboy 0.2.1

This commit is contained in:
Codex
2026-10-30 00:23:30 +02:00
parent b36d5acc8b
commit 23d4e49468
64 changed files with 2965 additions and 869 deletions
+12 -6
View File
@@ -1,5 +1,5 @@
# Run with Windows PowerShell 5.1. Russian strings come from UTF-8 JSON.
param([string]$Only = '')
param([string]$Only = '', [switch]$ReplaceRecordedVoices)
$ErrorActionPreference = 'Stop'
Add-Type -AssemblyName System.Runtime.WindowsRuntime
$null = [Windows.Media.SpeechSynthesis.SpeechSynthesizer, Windows.Media.SpeechSynthesis, ContentType=WindowsRuntime]
@@ -14,9 +14,16 @@ $story = Get-Content -LiteralPath (Join-Path $project 'data/phone_story.json') -
$output = Join-Path $project 'assets/voice'
New-Item -ItemType Directory -Force -Path $output | Out-Null
$metadata = @{}
$manifestPath = Join-Path $project 'data/voice_manifest.json'
if (Test-Path -LiteralPath $manifestPath) {
$existing = Get-Content -LiteralPath $manifestPath -Raw -Encoding UTF8 | ConvertFrom-Json
foreach ($property in $existing.PSObject.Properties) { $metadata[$property.Name] = $property.Value }
}
$generatedCount = 0
foreach ($property in $story.lines.PSObject.Properties) {
$id = $property.Name
if ($Only -and $id -ne $Only) { continue }
if (-not $ReplaceRecordedVoices -and $metadata.ContainsKey($id) -and $metadata[$id].provider -eq 'ElevenLabs') { continue }
$entry = $property.Value
$daughter = $entry.speaker -eq $story.lines.intro_01.speaker
$synth.Options.SpeakingRate = $(if ($daughter) { 1.16 } else { 1.05 })
@@ -31,10 +38,9 @@ foreach ($property in $story.lines.PSObject.Properties) {
$file.Dispose()
$stream.Dispose()
$metadata[$id] = @{ voice = $voice.DisplayName; speaker = $entry.speaker; text = $entry.text; provider = 'Windows Speech / draft'; file = 'assets/voice/' + $id + '.wav' }
$generatedCount++
}
$synth.Dispose()
if (-not $Only) {
$json = $metadata | ConvertTo-Json -Depth 5
[IO.File]::WriteAllText((Join-Path $project 'data/voice_manifest.json'), $json, [Text.UTF8Encoding]::new($false))
}
Write-Output ('Generated ' + $metadata.Count + ' draft voice clips with ' + $voice.DisplayName)
$json = $metadata | ConvertTo-Json -Depth 8
[IO.File]::WriteAllText($manifestPath, $json, [Text.UTF8Encoding]::new($false))
Write-Output ('Generated ' + $generatedCount + ' draft voice clips with ' + $voice.DisplayName)