Files
voice_copy/voice-changer/launcher/launcher.c
EJClaw b0460fdff7 Add Windows realtime voice changer (RVC via Applio) + set operator to 사금향
- voice-changer/: install.bat (uv + Python 3.12 + pinned Applio + torch cu128),
  VoiceChanger.exe launcher (mingw), tkinter GUI (model list, auto ±12 pitch
  across genders, mic/output/monitor devices, latency, noise gate),
  train.bat (preprocess/extract/train/index → models/<id>), examples.bat
  (Korean example models from KSS + Zeroth-Korean), build-release.sh
- consent-recorder: default OPERATOR_NAME=사금향

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 14:34:03 +09:00

30 lines
1.4 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;
}