- Fix state detection priority: dictation now takes precedence over conversation - Fix critical bug: event loop was created but never started, preventing async coroutines from executing - Optimize audio processing: reorder AcceptWaveform/PartialResult checks - Switch to faster Vosk model: vosk-model-en-us-0.22-lgraph for 2-3x speed improvement - Reduce block size from 8000 to 4000 for lower latency - Add filtering to remove spurious 'the', 'a', 'an' words from start/end of transcriptions - Update toggle-dictation.sh to properly clean up conversation lock file - Improve batch audio processing for better responsiveness
27 lines
906 B
Bash
Executable File
27 lines
906 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Toggle Dictation Service Control Script
|
|
# This script creates/removes the dictation lock file to control AI dictation state
|
|
|
|
DICTATION_DIR="/mnt/storage/Development/dictation-service"
|
|
LOCK_FILE="$DICTATION_DIR/listening.lock"
|
|
CONVERSATION_LOCK_FILE="$DICTATION_DIR/conversation.lock"
|
|
|
|
if [ -f "$LOCK_FILE" ]; then
|
|
# Stop dictation
|
|
rm "$LOCK_FILE"
|
|
notify-send "🎤 Dictation Stopped" "Press Alt+D to resume"
|
|
echo "$(date): AI dictation stopped" >> /tmp/dictation.log
|
|
else
|
|
# Stop conversation if running, then start dictation
|
|
if [ -f "$CONVERSATION_LOCK_FILE" ]; then
|
|
rm "$CONVERSATION_LOCK_FILE"
|
|
echo "$(date): Conversation stopped (dictation mode)" >> /tmp/conversation.log
|
|
fi
|
|
|
|
# Start dictation
|
|
touch "$LOCK_FILE"
|
|
notify-send "🎤 Dictation Started" "Speak now"
|
|
echo "$(date): AI dictation started" >> /tmp/dictation.log
|
|
fi
|