Add audio resampling utility and scipy dependency

- Created resample_audio.py utility script
  - Automatically reads target sample rate from config.json
  - Resamples all WAV files in sounds directory
  - Creates .backup files before modifying originals
  - Handles both mono and stereo audio
  - Uses scipy.signal.resample for high-quality resampling

- Added scipy>=1.7.0 dependency to pyproject.toml
- Updated Makefile sync command to include scipy
- Updated README.md with sample rate troubleshooting section
- Updated config example in README to show 48kHz default
- Added beep_sound configuration to README system section

This resolves sample rate mismatch errors when audio files
don't match the configured rate in config.json.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-27 13:02:39 +07:00
parent 52b8348a03
commit 30ac7e89e9
4 changed files with 190 additions and 2 deletions

View File

@@ -13,7 +13,7 @@ test:
sync:
@echo "Installing/syncing dependencies..."
uv pip install flask numpy pyaudio RPi.GPIO waitress
uv pip install flask numpy pyaudio RPi.GPIO waitress scipy
install: sync
@echo "Dependencies installed!"