#!/usr/bin/env bash # R6 缺口 sfx:victory(Stable Audio 3,英文 prompt 照录 docs/design/11 §5)。 # 用法: bash web/rpg/gen/gen_gap_sfx.sh (内部 flock 串行 GPU;输出 staging) set -u source /home/xsl/SoundGame/env.d/sfx.sh cd /home/xsl/SoundGame/tools/stable-audio-3 OUT=/home/xsl/SoundGame/web/rpg/gen/staging/sfx mkdir -p "$OUT" flock /home/xsl/SoundGame/.gpu.lock bash -c ' if [ -s "'"$OUT"'/victory.wav" ]; then echo "skip victory"; else uv run stable-audio --model small-sfx \ -p "triumphant short brass fanfare, 3 rising notes, wuxia style, under 1.5 seconds" \ --duration 2 -o "'"$OUT"'/victory.wav" 2>&1 | grep -i "saved\|error" fi' echo "done: $(ls "$OUT")"