auto-report-skill/scripts/overlay.sh
2026-04-21 18:09:28 +00:00

30 lines
1,018 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# Обёртка для запуска транскрипции с правильной настройкой окружения
set -euo pipefail
# CRITICAL: переменные для Intel oneMKL
export MKL_SERVICE_FORCE_INTEL=1
export OMP_NUM_THREADS=2
MEETING_DIR="${1:-.}"
if [ ! -f "$MEETING_DIR"/*.wav ] && [ ! -f "$MEETING_DIR"/*.WAV ]; then
echo "Error: No WAV file found in $MEETING_DIR"
exit 1
fi
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Check audio duration
DURATION=$(ffprobe -i "$MEETING_DIR"/*.wav -show_entries format=duration -v quiet -of csv="p=0" 2>/dev/null | cut -d. -f1)
if [ $DURATION -gt 1800 ]; then # >30 минут
echo "Audio is $DURATION seconds. Using chunked transcription..."
bash "$SCRIPT_DIR/transcribe_chunked.sh" "$MEETING_DIR"
else
echo "Audio is $DURATION seconds. Using standard transcription..."
bash "$SCRIPT_DIR/transcribe.sh" "$MEETING_DIR"
fi
echo "Transcription complete. Check $MEETING_DIR/transcription/"