- 共享引擎(app/src/main):GestureEngine 6 手势识别、AudioEngine 三层音频 (ExoPlayer BGM 交叉淡入 / 对白 ducking / SoundPool 低延迟)、Game/GameEngine 状态机接口、MainActivity 全屏封面 + TalkBack - 《声命线》storyline:末世互动广播剧,3 幕 8 抉择点 4 结局 - 《声东击西》reflex:听声辨位反应,12 波战斗 + BGM 三档 BPM 变速 - 《暗室》escape:3x3 网格密室逃脱,钥匙→铁柜→保险丝→电箱→大门谜题链 - 文档:setup(从零搭建)/ architecture(架构)/ engine-api(引擎 API)/ asset-pipeline(资产流水线)/ games/*(三款游戏设计文档) - 资产管线:Qwen3-TTS 对白 + 程序合成音效/BGM + Mureka BGM 的 gen 脚本与台账, 全部 ogg 资产入库可复现 - env.d 环境脚本:android/tts 入库;sfx/mureka 含密钥不入库,仅提交 .example.sh 模板
39 lines
1.5 KiB
Bash
Executable File
39 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Thin wrapper around scripts/benchmark.py — runs it via `uv run python`
|
|
# so the project's .venv is used automatically (no activation needed).
|
|
#
|
|
# Sweeps sm-music+same-s and medium+same-l across 5s / 30s / 120s / 380s
|
|
# clip lengths, recording wall time and peak RAM per cell. Pre-warms
|
|
# weights from HuggingFace so download time is excluded from the timings.
|
|
#
|
|
# Usage: ./benchmark.sh
|
|
#
|
|
set -euo pipefail
|
|
|
|
# Pre-emptively add the uv installer's default bin dir to PATH (matches ./sa3).
|
|
export PATH="${XDG_BIN_HOME:-$HOME/.local/bin}:$HOME/.local/bin:$PATH"
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
if [[ -t 1 ]]; then
|
|
RED=$'\033[1;31m'; BOLD=$'\033[1m'; RESET=$'\033[0m'
|
|
else
|
|
RED=""; BOLD=""; RESET=""
|
|
fi
|
|
fail() { printf '\n%serror%s: %s\n' "$RED" "$RESET" "$1" >&2; exit 1; }
|
|
|
|
# Sanity: we need uv, the project .venv, and the benchmark script itself.
|
|
command -v uv >/dev/null 2>&1 || \
|
|
fail "uv not found. Run ${BOLD}./install.sh${RESET} first to set up the environment."
|
|
[[ -d "$SCRIPT_DIR/.venv" ]] || \
|
|
fail "no .venv/ found. Run ${BOLD}./install.sh${RESET} first."
|
|
[[ -f "$SCRIPT_DIR/scripts/benchmark.py" ]] || \
|
|
fail "scripts/benchmark.py not found — repo files are missing."
|
|
|
|
cd "$SCRIPT_DIR"
|
|
# Invoke .venv/bin/python directly (same reasoning as ./sa3 — uv run
|
|
# walks up to a parent pyproject.toml and --no-project creates an
|
|
# empty ephemeral env in newer uv versions).
|
|
exec "$SCRIPT_DIR/.venv/bin/python" scripts/benchmark.py "$@"
|