@echo off
setlocal
cd /d "%~dp0"
title TiHiY Voice Translator v9.11.2

py -c "import PySide6, sounddevice, soundfile, numpy, keyboard; from openai import OpenAI" >nul 2>nul
if errorlevel 1 (
  echo Installing or updating dependencies...
  py -m pip install -r requirements.txt
  if errorlevel 1 goto :error
)

py -m app.main
if errorlevel 1 goto :error
exit /b 0

:error
echo.
echo Program finished with an error.
echo Crash log: %%LOCALAPPDATA%%\TiHiY Voice Translator\crash.log
pause
