refactor: improve Docker speech container audio configuration and user permissions
- Update Dockerfile to enhance audio setup and user management - Modify setup-audio.sh to add robust PulseAudio socket and device checks - Add proper user and directory permissions for audio and model directories - Simplify container startup process and improve audio device detection
This commit is contained in:
@@ -1,7 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Wait for PulseAudio to be ready
|
||||
sleep 2
|
||||
# Wait for PulseAudio socket to be available
|
||||
while [ ! -e /run/user/1000/pulse/native ]; do
|
||||
echo "Waiting for PulseAudio socket..."
|
||||
sleep 1
|
||||
done
|
||||
|
||||
# Test PulseAudio connection
|
||||
pactl info || {
|
||||
echo "Failed to connect to PulseAudio server"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# List audio devices
|
||||
pactl list sources || {
|
||||
echo "Failed to list audio devices"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Start the wake word detector
|
||||
python /app/wake_word_detector.py
|
||||
|
||||
# Mute the monitor to prevent feedback
|
||||
pactl set-source-mute alsa_output.pci-0000_00_1b.0.analog-stereo.monitor 1
|
||||
|
||||
Reference in New Issue
Block a user