$ErrorActionPreference = 'Stop' $root = Split-Path -Parent $PSScriptRoot Set-Location $root if(-not (Test-Path '.venv\Scripts\python.exe')){ throw 'Ejecuta primero scripts\instalar.ps1' } $config = Get-Content 'config.json' -Raw | ConvertFrom-Json New-Item -ItemType Directory -Force -Path 'voices' | Out-Null Write-Host "Descargando voz: $($config.piper.voice). Verifica su timbre en los ejemplos de Piper." & '.\.venv\Scripts\python.exe' -m piper.download_voices --data-dir voices $config.piper.voice if($LASTEXITCODE -ne 0){ throw 'Error descargando voz. Revisa nombre/modelo o tu conexion.' } Write-Host 'Archivos de voz listos en voices/' -ForegroundColor Green