Files
voice_copy/voice-changer/launcher/launcher.c
EJClaw 21b4278b77 voice-changer: one-click installer, mic APO instead of virtual cable, keep all files in install folder
- 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>
2026-11-11 16:33:15 +09:00

30 lines
1.5 KiB
C

/* VoiceChanger.exe: 같은 폴더의 env\Scripts\pythonw.exe 로 app\voice_changer.py 를 띄우는 실행기.
빌드: x86_64-w64-mingw32-gcc -O2 -municode -mwindows launcher.c -o VoiceChanger.exe */
#include <windows.h>
#include <wchar.h>
int WINAPI wWinMain(HINSTANCE h, HINSTANCE p, PWSTR cmd, int show) {
wchar_t dir[MAX_PATH], py[MAX_PATH], script[MAX_PATH], line[3 * MAX_PATH];
DWORD n = GetModuleFileNameW(NULL, dir, MAX_PATH);
if (n == 0 || n >= MAX_PATH) return 1;
wchar_t *slash = wcsrchr(dir, L'\\');
if (slash) *slash = 0;
_snwprintf(py, MAX_PATH, L"%ls\\env\\Scripts\\pythonw.exe", dir);
_snwprintf(script, MAX_PATH, L"%ls\\app\\voice_changer.py", dir);
if (GetFileAttributesW(py) == INVALID_FILE_ATTRIBUTES) {
MessageBoxW(NULL, L"설치가 아직 끝나지 않았습니다 (엔진을 다 내려받지 못함).\n설치 폴더의 install.bat 을 실행하면 받은 곳부터 이어서 받습니다.", L"음성 변환기", MB_ICONWARNING);
return 1;
}
_snwprintf(line, 3 * MAX_PATH, L"\"%ls\" \"%ls\"", py, script);
SetEnvironmentVariableW(L"PYTHONUTF8", L"1");
STARTUPINFOW si = {sizeof(si)};
PROCESS_INFORMATION pi;
if (!CreateProcessW(py, line, NULL, NULL, FALSE, 0, NULL, dir, &si, &pi)) {
MessageBoxW(NULL, L"음성 변환기를 시작하지 못했습니다. 설치 폴더의 install.bat 을 다시 실행해 주세요.", L"음성 변환기", MB_ICONERROR);
return 1;
}
CloseHandle(pi.hThread);
CloseHandle(pi.hProcess);
return 0;
}