-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtoggle-streaming.sh
More file actions
executable file
·60 lines (51 loc) · 1.63 KB
/
toggle-streaming.sh
File metadata and controls
executable file
·60 lines (51 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
# Toggle VoxTerm STREAMING mode
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PID_FILE="$SCRIPT_DIR/.voice-dictation-streaming.pid"
# Check if already running
if [ -f "$PID_FILE" ]; then
PID=$(cat "$PID_FILE")
if ps -p "$PID" > /dev/null 2>&1; then
# Already running - stop it
echo "🛑 Stopping VoxTerm Streaming (PID: $PID)..."
kill "$PID" 2>/dev/null
rm -f "$PID_FILE"
echo "✅ VoxTerm Streaming stopped"
exit 0
else
# PID file exists but process is not running
rm -f "$PID_FILE"
fi
fi
# Not running - start it
echo "🚀 Starting VoxTerm STREAMING mode..."
# Check if access key is set, if not try to load from ~/.zshrc
if [ -z "$PICOVOICE_ACCESS_KEY" ]; then
if [ -f ~/.zshrc ]; then
source ~/.zshrc
fi
fi
# Check again after sourcing
if [ -z "$PICOVOICE_ACCESS_KEY" ]; then
echo ""
echo "⚠️ Warning: PICOVOICE_ACCESS_KEY environment variable not set"
echo " Please add to ~/.zshrc:"
echo " export PICOVOICE_ACCESS_KEY='your-key-here'"
echo ""
exit 1
fi
cd "$SCRIPT_DIR"
source venv/bin/activate
# Start in background
PICOVOICE_ACCESS_KEY="$PICOVOICE_ACCESS_KEY" python -u main_streaming.py > /tmp/voice-dictation-streaming.log 2>&1 &
PID=$!
echo $PID > "$PID_FILE"
echo "✅ VoxTerm Streaming started (PID: $PID)"
echo "📝 Log file: /tmp/voice-dictation-streaming.log"
echo ""
echo "🎤 Say 'computer' to activate"
echo "✨ Text will appear AS YOU SPEAK"
echo "🛑 Run this script again to stop"
echo ""
echo "💡 Tip: Watch logs with: tail -f /tmp/voice-dictation-streaming.log"
echo ""