Add scripts

This commit is contained in:
Слонова Анна 2026-04-21 18:09:28 +00:00
parent 992a748c51
commit ba56147e95
4 changed files with 329 additions and 0 deletions

30
scripts/overlay.sh Normal file
View file

@ -0,0 +1,30 @@
#!/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/"