Download Convert.ps1 from Esmerubphire/FeiyuVoice-RVC: direct link, hf CLI and curl.
- Browser
- Download file 1.27 kB
-
https://huggingface.co/Esmerubphire/FeiyuVoice-RVC/resolve/main/Convert.ps1
- Command line
-
hf download hf://Esmerubphire/FeiyuVoice-RVC/Convert.ps1
-
curl -L -o Convert.ps1 https://huggingface.co/Esmerubphire/FeiyuVoice-RVC/resolve/main/Convert.ps1
1.27 kB
| param( | |
| [string]$InputAudio, | |
| [string]$RegionsJson, | |
| [string]$OutputDirectory, | |
| [switch]$VerifyOnly | |
| ) | |
| $ErrorActionPreference = 'Stop' | |
| $runner = Join-Path $PSScriptRoot 'run_rvc.py' | |
| if ($VerifyOnly) { | |
| & python -B $runner --verify-only | |
| if ($LASTEXITCODE -ne 0) { throw 'Release verification failed.' } | |
| return | |
| } | |
| $runtime = Get-Content -LiteralPath (Join-Path $PSScriptRoot 'runtime.local.json') -Raw -Encoding utf8 | ConvertFrom-Json | |
| function To-WslPath([string]$Value) { | |
| $full = [IO.Path]::GetFullPath($Value).Replace('\','/') | |
| if ($full -notmatch '^[A-Za-z]:/') { throw 'Use an absolute local drive path.' } | |
| return '/mnt/' + $full.Substring(0,1).ToLower() + $full.Substring(2) | |
| } | |
| if (-not $InputAudio) { throw 'Supply -InputAudio with a clean vocal WAV or FLAC.' } | |
| $taskArgs = @((To-WslPath $runner), '--input', (To-WslPath ((Resolve-Path -LiteralPath $InputAudio).Path))) | |
| if ($RegionsJson) { $taskArgs += @('--regions', (To-WslPath ((Resolve-Path -LiteralPath $RegionsJson).Path))) } | |
| if ($OutputDirectory) { $taskArgs += @('--output-dir', (To-WslPath $OutputDirectory)) } | |
| & wsl.exe -d $runtime.wsl_distribution -e $runtime.wsl_python -B @taskArgs | |
| if ($LASTEXITCODE -ne 0) { throw 'Conversion failed; inspect the new output directory and keep the native audio.' } | |