Changes: - Update default sample rate from 44.1kHz to 48kHz (more professional standard) - Add sample rate validation in play_sound_file() - Display clear warning when uploaded file doesn't match configured rate - Update default sound generation (dial tone & beep) to use configured RATE - Prevent playback of incompatible sample rates (avoids ALSA errors) Error Handling: - Check file sample rate before attempting playback - Print warning with actual vs expected sample rate - Return False and skip playback if mismatch detected - User-friendly error message with resampling instructions This fixes the "Invalid sample rate" error when playing files with non-matching sample rates. Users must now resample their audio files to match the configured rate (default 48kHz). To resample audio files: ffmpeg -i input.wav -ar 48000 output.wav 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
44 lines
892 B
JSON
44 lines
892 B
JSON
{
|
|
"gpio": {
|
|
"hook_pin": 17,
|
|
"hook_pressed_state": "LOW",
|
|
"extra_button_enabled": true,
|
|
"extra_button_pin": 27,
|
|
"extra_button_pressed_state": "LOW"
|
|
},
|
|
"audio": {
|
|
"device_index": 1,
|
|
"chunk_size": 1024,
|
|
"format": "paInt16",
|
|
"channels": 1,
|
|
"sample_rate": 48000,
|
|
"max_record_seconds": 300
|
|
},
|
|
"paths": {
|
|
"base_dir": "./rotary_phone_data",
|
|
"recordings_dir": "recordings",
|
|
"sounds_dir": "sounds"
|
|
},
|
|
"backup": {
|
|
"enabled": true,
|
|
"usb_paths": [
|
|
"/media/usb0",
|
|
"/media/usb1"
|
|
],
|
|
"verify_crc": true,
|
|
"backup_on_write": true
|
|
},
|
|
"web": {
|
|
"port": 8080,
|
|
"max_upload_size_mb": 50
|
|
},
|
|
"system": {
|
|
"active_greeting": "dialtone.wav",
|
|
"extra_button_sound": "button_sound.wav",
|
|
"beep_sound": "beep.wav",
|
|
"beep_enabled": true,
|
|
"greeting_delay_seconds": 0,
|
|
"volume": 70
|
|
}
|
|
}
|