Something went wrong. Try again.
Something went wrong. Try again.
voice-assistant test_setup.sh
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748#!/bin/bash# Test script for voice assistant setup
set -e
echo "==================================="echo "Voice Assistant Setup Test"echo "==================================="
echo ""echo "1. Checking audio devices..."python3 -c "import sounddevice as sd; devices = sd.query_devices(); print('Input devices:'); [print(f' {i}: {d[\"name\"]}') for i, d in enumerate(devices) if d['max_input_channels'] > 0]"
echo ""echo "2. Testing microphone recording (3 seconds)..."python3 -c "import sounddevice as sdimport numpy as np
print('Recording...')recording = sd.rec(48000, samplerate=16000, channels=1, dtype='float32')sd.wait()print(f'Recorded {len(recording)} samples')print(f'Volume: {np.abs(recording).mean():.4f}')
if np.abs(recording).mean() > 0.01: print('✓ Microphone is working!')else: print('✗ Microphone might not be detecting sound')"
echo ""echo "3. Checking Python packages..."python3 -c "import sounddevice; print('✓ sounddevice')import websocket; print('✓ websocket-client')import webrtcvad; print('✓ webrtcvad')"
echo ""echo "==================================="echo "Setup test complete!"echo "==================================="echo ""echo "To run the voice client:"echo " python3 voice_client/local_client.py --server ws://YOUR_SERVER_IP:8888"echo ""