- apo/: VoiceChangerAPO.dll (SFX APO on the real mic, built with mingw). When the app converts, the mic's own stream carries the converted voice; otherwise it passes the real voice through. Shared-memory protocol in vccore.h, Python side app/mic_bridge.py - scripts/mic-apo.ps1: register/unregister on every capture endpoint with admin value rights only (no ACL changes unless FxProperties is missing), originals backed up and restored - app: mic is the conversion target (WASAPI names), no output device, '마이크 다시 연결' button, 44.1k<->48k streaming resample, caches/temp redirected into <install>/cache - installer/VoiceChanger.iss (Inno Setup): choose install folder, register APO, download engine into that folder, uninstall restores mic settings and asks before deleting models - install.ps1: uv python --no-bin --no-registry, temp/caches inside the folder, uv cache clean - tests: C core compiled with gcc against the Python bridge; converter pump 44.1k round trip Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
76 lines
3.8 KiB
PowerShell
76 lines
3.8 KiB
PowerShell
# 음성 변환기 설치: uv → Python 3.12 → Applio 엔진(고정 커밋) → torch(CUDA 12.8, RTX 50 지원) → 기본 모델
|
|
$ErrorActionPreference = "Stop"
|
|
$ProgressPreference = "SilentlyContinue"
|
|
[Console]::OutputEncoding = [Text.Encoding]::UTF8
|
|
$Root = Split-Path -Parent $PSScriptRoot
|
|
Set-Location $Root
|
|
|
|
# Applio (MIT) 고정 커밋. 올릴 때는 이 값만 바꾸고 다시 install.bat
|
|
$ApplioCommit = "6d5d9511b7e719b1f613362bc767e841ad72fa72"
|
|
$UvVersion = "0.13.7"
|
|
|
|
$Tools = Join-Path $Root "tools"
|
|
$Uv = Join-Path $Tools "uv.exe"
|
|
$Engine = Join-Path $Root "engine"
|
|
$VenvDir = Join-Path $Root "env"
|
|
New-Item -ItemType Directory -Force $Tools | Out-Null
|
|
|
|
if (-not (Test-Path $Uv)) {
|
|
Write-Host "[1/5] uv 받기..."
|
|
$zip = Join-Path $Tools "uv.zip"
|
|
Invoke-WebRequest "https://github.com/astral-sh/uv/releases/download/$UvVersion/uv-x86_64-pc-windows-msvc.zip" -OutFile $zip
|
|
Expand-Archive $zip -DestinationPath $Tools -Force
|
|
Remove-Item $zip
|
|
} else { Write-Host "[1/5] uv 있음" }
|
|
|
|
$stamp = Join-Path $Engine ".commit"
|
|
if (-not (Test-Path $stamp) -or (Get-Content $stamp) -ne $ApplioCommit) {
|
|
Write-Host "[2/5] 엔진(Applio $($ApplioCommit.Substring(0,7))) 받기..."
|
|
$zip = Join-Path $Tools "applio.zip"
|
|
Invoke-WebRequest "https://github.com/IAHispano/Applio/archive/$ApplioCommit.zip" -OutFile $zip
|
|
$tmp = Join-Path $Tools "applio_tmp"
|
|
if (Test-Path $tmp) { Remove-Item -Recurse -Force $tmp }
|
|
Expand-Archive $zip -DestinationPath $tmp -Force
|
|
$src = Get-ChildItem $tmp | Select-Object -First 1
|
|
# 받아 둔 기본 모델(rvc/models)은 남기고 코드만 바꾼다
|
|
if (Test-Path $Engine) {
|
|
Get-ChildItem $Engine -Exclude "rvc","ffmpeg.exe","ffprobe.exe" | Remove-Item -Recurse -Force
|
|
}
|
|
New-Item -ItemType Directory -Force $Engine | Out-Null
|
|
Copy-Item -Recurse -Force (Join-Path $src.FullName "*") $Engine
|
|
Remove-Item -Recurse -Force $tmp, $zip
|
|
Set-Content $stamp $ApplioCommit
|
|
} else { Write-Host "[2/5] 엔진 있음" }
|
|
|
|
# 받는 것 · 캐시 · 임시 파일을 모두 이 폴더 안에 둔다 (사용자 폴더 %TEMP% · %LOCALAPPDATA% · 레지스트리에 안 남김)
|
|
$Temp = Join-Path $Root "cache\temp"
|
|
New-Item -ItemType Directory -Force $Temp | Out-Null
|
|
$env:TEMP = $Temp; $env:TMP = $Temp
|
|
$env:UV_PYTHON_INSTALL_DIR = Join-Path $Tools "python"
|
|
$env:UV_CACHE_DIR = Join-Path $Tools "uv-cache"
|
|
$env:UV_PYTHON_BIN_DIR = Join-Path $Tools "python-bin"
|
|
$env:UV_TOOL_DIR = Join-Path $Tools "uv-tools"
|
|
$env:UV_NO_CONFIG = "1"
|
|
$env:PYTHONNOUSERSITE = "1"
|
|
if (-not (Test-Path (Join-Path $VenvDir "Scripts\python.exe"))) {
|
|
Write-Host "[3/5] Python 3.12 환경 만들기..."
|
|
& $Uv python install 3.12 --no-bin --no-registry
|
|
if ($LASTEXITCODE -ne 0) { throw "Python 을 받지 못했습니다" }
|
|
& $Uv venv --python 3.12 --managed-python --no-python-downloads $VenvDir
|
|
if ($LASTEXITCODE -ne 0) { throw "Python 환경을 만들지 못했습니다" }
|
|
} else { Write-Host "[3/5] Python 환경 있음" }
|
|
|
|
Write-Host "[4/5] 패키지 설치 (torch CUDA 12.8 포함, 처음엔 약 4GB)..."
|
|
& $Uv pip install --python (Join-Path $VenvDir "Scripts\python.exe") -r (Join-Path $Engine "requirements-engine.txt") pyarrow `
|
|
--extra-index-url https://download.pytorch.org/whl/cu128 --index-strategy unsafe-best-match
|
|
if ($LASTEXITCODE -ne 0) { throw "패키지 설치에 실패했습니다" }
|
|
|
|
Write-Host "[5/5] 기본 모델 받기 · GPU 확인..."
|
|
& (Join-Path $VenvDir "Scripts\python.exe") (Join-Path $Root "app\setup_engine.py")
|
|
if ($LASTEXITCODE -ne 0) { throw "기본 모델 받기 또는 GPU 확인에 실패했습니다" }
|
|
|
|
# 내려받은 패키지 캐시는 env 에 이미 풀려 있으니 지워서 디스크를 아낀다 (install.bat 을 다시 돌리면 다시 받음)
|
|
& $Uv cache clean | Out-Null
|
|
Write-Host ""
|
|
Write-Host "설치가 끝났습니다. VoiceChanger.exe 로 실행하세요."
|