-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
40 lines (34 loc) · 1.76 KB
/
config.py
File metadata and controls
40 lines (34 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
"""
config.py — Constants and shared configuration for Chaotics Slice.
"""
import sys
from pathlib import Path
# ── Base directories ──────────────────────────────────────────────────────────
if getattr(sys, "frozen", False):
BUNDLE_DIR = Path(sys._MEIPASS)
DATA_DIR = Path(sys.executable).parent
else:
BUNDLE_DIR = Path(__file__).parent
DATA_DIR = Path(__file__).parent
OUTPUT_FOLDER = DATA_DIR / "outputs"
TEMP_FOLDER = DATA_DIR / "temp"
OUTPUT_FOLDER.mkdir(exist_ok=True)
TEMP_FOLDER.mkdir(exist_ok=True)
# ── File handling ─────────────────────────────────────────────────────────────
ALLOWED_EXTENSIONS = {".mp4", ".mkv", ".mov", ".avi", ".webm", ".m4v", ".flv"}
MAX_UPLOAD_SIZE = 8 * 1024 * 1024 * 1024 # 8 GB
# ── VAD mode presets ──────────────────────────────────────────────────────────
# Used by parse_params to map mode → silence/padding defaults
MODE_PRESETS = {
"chill": {"padding": 350, "min_silence": 600},
"normal": {"padding": 200, "min_silence": 300},
"tight": {"padding": 80, "min_silence": 150},
"savage": {"padding": 30, "min_silence": 80},
}
# Default threshold + min_speech per mode (used to detect "custom" params)
MODE_DEFAULTS = {
"chill": {"threshold": 0.4, "min_speech_ms": 400},
"normal": {"threshold": 0.5, "min_speech_ms": 250},
"tight": {"threshold": 0.6, "min_speech_ms": 150},
"savage": {"threshold": 0.7, "min_speech_ms": 80},
}