#!/bin/bash # cipher BGM 4 任务串行提交(429 退避重试,间隔 20s;与并行泳道错峰)。 set -u cd "$(dirname "$0")/.." source env.d/mureka.sh submit() { # submit local track="$1" prompt="$2" attempt for attempt in 1 2 3 4 5 6; do echo "== $track attempt $attempt ==" if python3 tools/mureka_gen.py --prompt "$prompt" --out "tools/mureka_out/cipher-$track" 2>&1 | tail -4; then if ls "tools/mureka_out/cipher-$track"/ 2>/dev/null | grep -q flac; then echo "== $track OK ==" return 0 fi fi echo "== $track retry in 45s ==" sleep 45 done echo "== $track FAILED ==" return 1 } submit radio_room "1940s late night wireless station room, warm tube radio hum, distant muffled swing jazz through a wall, rain on window, clock tick, smoky and quiet, no vocals, seamless loop, 60-90 seconds" sleep 20 submit closing "Tense noir waltz for a spy's last night, muted brushed drums, low strings, subtle telegraph tick rhythm, restrained dread, no vocals, seamless loop, 60-90 seconds" sleep 20 submit night "Quiet night interlude, sparse felt piano over warm vinyl static and soft rain, lonely but safe, no drums, no vocals, seamless loop, 60-90 seconds" sleep 20 submit ending "Dawn after a long night of rain, warm strings and soft piano, exhausted hope, quiet resolution, no vocals, seamless loop, 60-90 seconds" echo "== ALL DONE ==" ls -la tools/mureka_out/ | grep cipher