Files
momentry_core/play_continuous.sh
Warren b54c2def30 feat: add migrations, test scripts, and utility tools
- Add database migrations (006-028) for face recognition, identity, file_uuid
- Add test scripts for ASR, face, search, processing
- Add portal frontend (Tauri)
- Add config, benchmark, and monitoring utilities
- Add model checkpoints and pretrained model references
2026-04-30 15:11:53 +08:00

65 lines
2.0 KiB
Bash
Executable File

#!/bin/bash
# 简化版连续演示 - 直接使用 ASRX 数据播放
set -e
VIDEO=/tmp/charade_audio.wav
ASRX=/tmp/asrx_charade_optimized.json
# 检查数据
if [ ! -f "$VIDEO" ] || [ ! -f "$ASRX" ]; then
echo "⚠️ 测试数据不存在,正在生成..."
cd scripts/asrx_self
python3 test_long_movie.py
cd ../..
fi
echo "🎬 连续演示模式"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "📺 从头到尾播放所有 ASRX 片段"
echo "⏸️ 按 Ctrl+C 停止"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo
# 检查是否显示视频
SHOW_VIDEO=""
if [ "$1" = "--video" ]; then
SHOW_VIDEO="1"
echo "📺 视频模式:将显示视频窗口"
echo
fi
# 统计信息
TOTAL=$(jq '.segments | length' "$ASRX")
echo "📊 总片段数: $TOTAL"
echo
# 播放计数
COUNT=0
# 使用 jq 提取 ASRX 片段并播放
jq -r '.segments[] | "\(.start)|\(.end)|\(.speaker)|\(.duration)"' "$ASRX" | while IFS='|' read -r start end speaker duration; do
COUNT=$((COUNT + 1))
# 显示进度
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "[$COUNT/$TOTAL] 🎤 $speaker"
echo "${start}s - ${end}s (${duration}s)"
# 播放片段
if [ -n "$SHOW_VIDEO" ]; then
ffplay -ss "$start" -t "$duration" -autoexit -x 800 -y 600 "$VIDEO" 2>/dev/null
else
echo "🔊 播放中..."
ffplay -ss "$start" -t "$duration" -autoexit -nodisp "$VIDEO" 2>/dev/null
fi
# 短暂停顿
sleep 0.05
done
echo
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "✅ 演示完成!共播放 $TOTAL 个片段"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"