#!/bin/bash # 測試整合播放器 set -e echo "🎬 Integrated Player 測試腳本" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" # 檢查編譯 if [ ! -f ./target/debug/integrated_player ]; then echo "⏳ 編譯整合播放器..." cargo build --bin integrated_player fi echo "✓ 播放器已編譯" echo # 測試 1: 查看幫助 echo "📋 測試 1: 查看幫助信息" echo "───────────────────────────────────────" ./target/debug/integrated_player --help echo # 測試 2: 使用 Charade 數據 echo "🎬 測試 2: Charade 數據測試" echo "───────────────────────────────────────" VIDEO=/tmp/charade_audio.wav ASRX=/tmp/asrx_charade_optimized.json FACE=/tmp/face_long.json if [ -f "$VIDEO" ] && [ -f "$ASRX" ]; then echo "✓ 找到測試數據: Charade (1963)" echo # 測試 2.1: 列出說話人 echo "📊 測試 2.1: 列出說話人統計" echo "───────────────────────────────────────" echo "提示: 進入交互模式後輸入 'l' 列出說話人" echo # 創建測試輸入 cat >/tmp/test_commands.txt <<'EOF' l q EOF ./target/debug/integrated_player \ --video "$VIDEO" \ --asrx "$ASRX" \ /tmp/test_play.txt <<'EOF' p SPEAKER_1 q EOF ./target/debug/integrated_player \ --video "$VIDEO" \ --asrx "$ASRX" \