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>
3.0 KiB
3.0 KiB
Sing Detect — project context for Claude
This file is auto-loaded each session and travels with the folder, so it stays
valid even after the folder is renamed (stream-studio → sing_detect_v2).
What this project is
A Windows desktop app (Tauri 2: Rust backend + TypeScript/WebView2 UI) that
detects singing segments in stream recordings and exports editor markers
(EDL / markers CSV / CSV / JSON). It is the detection-only spin-off of the
former "Stream Studio"; the video-concat feature was split into a separate
project (video_concat_v5, since moved out of this folder).
- Crate:
sing-detect/ libsing_detect_lib. Product: Sing Detect. - Detection runs a Python 3.10 sidecar (
sidecar/detect.py, inaSpeechSegmenter + TensorFlow). ffmpeg extracts a 16 kHz WAV first.
Build / run (Windows)
dev.bat— hot-reload dev.build.bat— MSI installer →src-tauri\target\release\bundle\msi\.pack.bat— standalone portable folder →dist-portable\SingDetect\(bundlesSing Detect.exe+ ffmpeg/ffprobe + the Pythonsidecar/).- Requirements on the build machine: Node, Rust (
winget install Rustlang.Rustup), VS 2022 C++ tools, ffmpeg atC:\ffmpeg\bin(or on PATH).
⚠️ State left by the rename (READ FIRST if a build fails)
src-tauri\target\andsrc-tauri\gen\were intentionally deleted before the folder rename, because cargo bakes absolute paths intotarget\and a build under the old path name fails withos error 3 (系统找不到指定的路径)referencing the old folder. The first build after rename is a full ~5–8 min recompile — this is expected, not an error.node_modules\anddist-portable\SingDetect\were kept (relocatable / self-contained). The existingSing Detect.exeindist-portable\works regardless of the folder name.- Do not keep
target\in a Nextcloud-synced location — it re-introduces the stale-absolute-path build failure across machines.
Detection environment (per-machine)
- Needs Python 3.10 (TensorFlow has no 3.12+ support). The app's in-UI
"Test detection engine" button checks the env and auto-installs the ML
packages + downloads the model on first run (or run
sidecar\setup_sidecar.bat). - Setup uses default international PyPI and does no proxy manipulation — pip
and the model download just inherit the system network settings, so a VPN/proxy
(e.g. Clash) routes them normally. Keep pip reasonably current: the very old pip
21.2.3 bundled with Python 3.10.0 crashes through an HTTP proxy
(
check_hostname requires server_hostname); installing Python 3.10.11 (ships a modern pip) or runningpy -3.10 -m pip install -U piponce avoids it.
Notable backend behavior
- Long ops (
detect_songs,setup_detection,export_segments) run viaspawn_blockingso the window stays responsive (not "未响应"). cancelkills the whole process tree (taskkill /F /T), becausepy -3.10spawnspython.exeas a child — killing onlypyleft it running.