v7: standalone Sing Detect app — full Tauri project tree

Promotes the v6 detection slice into a complete, buildable Tauri 2 app and
renames Stream Studio → Sing Detect (detection-only; video-concat split to its
own project). Proper src/ + src-tauri/ layout, Python sidecar under sidecar/,
app icons, package/Cargo manifests, and dev/build/pack scripts.

Pipeline unchanged in spirit: Rust drives ffmpeg to a 16 kHz mono WAV, the
Python sidecar (inaSpeechSegmenter) emits line-JSON segments, and Rust writes
EDL / markers CSV / CSV / JSON exports. Long ops run on spawn_blocking; cancel
kills the whole py -3.10 process tree.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-26 23:12:25 +08:00
parent 765816e701
commit 4887981a2d
51 changed files with 8250 additions and 52 deletions

54
pack.bat Normal file
View File

@@ -0,0 +1,54 @@
@echo off
REM ============================================================
REM Sing Detect - build a PORTABLE folder for ANY Windows PC.
REM
REM Run this instead of build.bat when you want a copy-paste app.
REM Output: dist-portable\SingDetect\
REM Usage: copy that whole folder anywhere, double-click
REM "Sing Detect.exe". ffmpeg is bundled inside.
REM ============================================================
setlocal EnableDelayedExpansion
set "PATH=%USERPROFILE%\.cargo\bin;%PATH%"
cd /d "%~dp0"
REM --- 1. Locate ffmpeg.exe + ffprobe.exe --------------------
set "FFMPEG="
set "FFPROBE="
if exist "C:\ffmpeg\bin\ffmpeg.exe" set "FFMPEG=C:\ffmpeg\bin\ffmpeg.exe"
if exist "C:\ffmpeg\bin\ffprobe.exe" set "FFPROBE=C:\ffmpeg\bin\ffprobe.exe"
if not defined FFMPEG for /f "delims=" %%i in ('where ffmpeg 2^>nul') do if not defined FFMPEG set "FFMPEG=%%i"
if not defined FFPROBE for /f "delims=" %%i in ('where ffprobe 2^>nul') do if not defined FFPROBE set "FFPROBE=%%i"
if not defined FFMPEG ( echo [ERROR] ffmpeg.exe not found. Install ffmpeg or place it in C:\ffmpeg\bin & pause & exit /b 1 )
if not defined FFPROBE ( echo [ERROR] ffprobe.exe not found. Install ffmpeg or place it in C:\ffmpeg\bin & pause & exit /b 1 )
echo Using ffmpeg: !FFMPEG!
echo Using ffprobe: !FFPROBE!
REM --- 2. Build the release app ------------------------------
if not exist "node_modules" call npm install
echo Building release (this takes a few minutes the first time)...
call npm run tauri build
if errorlevel 1 ( echo [ERROR] Build failed. & pause & exit /b 1 )
REM --- 3. Assemble the portable folder ----------------------
set "OUT=dist-portable\SingDetect"
if exist "dist-portable" rmdir /s /q "dist-portable"
mkdir "%OUT%"
copy /y "src-tauri\target\release\sing-detect.exe" "%OUT%\Sing Detect.exe" >nul
copy /y "!FFMPEG!" "%OUT%\ffmpeg.exe" >nul
copy /y "!FFPROBE!" "%OUT%\ffprobe.exe" >nul
xcopy /e /i /y "sidecar" "%OUT%\sidecar" >nul
echo.
echo ============================================================
echo DONE. Your portable app is here:
echo %CD%\%OUT%
echo.
echo Copy that whole "SingDetect" folder to any Windows PC and
echo double-click "Sing Detect.exe". ffmpeg is included.
echo.
echo Detection needs Python 3.10 on the target PC. The app has a
echo built-in "Test detection engine" button that installs the
echo ML packages and model for you on first run.
echo ============================================================
pause