8254ccde86
- Dockerfile + docker-compose.yml: two services (recorder + web) sharing ./recordings bind mount; recorder maps /dev/snd for ALSA soundcard access - requirements.txt: requests, numpy, soundfile - .dockerignore, updated .gitignore (add __pycache__, .pytest_cache) - isr.py: add SIGTERM handler for clean Docker shutdown; fix stale error message that referenced removed PulseAudio/PipeWire/PortAudio backends - web.py: translate all German UI strings to English - config.example.ini: remove PipeWire/PulseAudio/PortAudio backend refs, simplify soundcard tips to ALSA only - README.md: full rewrite as user guide (quick start, config reference, Docker notes, how it works) - CLAUDE.md: update architecture section to reflect ALSA-only backend - Delete changelog.txt and guide.md (internal session notes)
147 lines
4.6 KiB
INI
147 lines
4.6 KiB
INI
# ISR - Audio Recorder Configuration
|
|
# Supports multiple recording sources: Icecast streams and soundcards
|
|
#
|
|
# Configuration sections:
|
|
# [general] - Shared settings for all sources (optional)
|
|
# [sourcename] - One section per recording source (name is your choice)
|
|
#
|
|
# Each source section must have 'type' set to either 'stream' or 'soundcard'
|
|
|
|
# =============================================================================
|
|
# GENERAL SETTINGS (optional - can be overridden per source)
|
|
# =============================================================================
|
|
[general]
|
|
# Output directory for recordings (will be created if it doesn't exist)
|
|
output_directory = recordings
|
|
|
|
# Duration in minutes after which to split into a new file
|
|
split_minutes = 60
|
|
|
|
# Filename pattern with strftime format codes
|
|
# Examples:
|
|
# %Y%m%d_%H%M%S -> 20241216_143000.ext
|
|
# recording_%Y-%m-%d_%H%M -> recording_2024-12-16_1430.ext
|
|
# %Y/%m/%d/audio_%H%M%S -> 2024/12/16/audio_143000.ext (creates subdirs)
|
|
# Common codes: %Y=year, %m=month, %d=day, %H=hour, %M=minute, %S=second
|
|
filename_pattern = %Y%m%d_%H%M%S
|
|
|
|
# Maximum number of connection/recording retry attempts before giving up
|
|
max_retries = 10
|
|
|
|
# Delay in seconds between retry attempts
|
|
retry_delay_seconds = 5
|
|
|
|
# Logging level: DEBUG, INFO, WARNING, ERROR, CRITICAL
|
|
log_level = INFO
|
|
|
|
# Log file location
|
|
log_file = recorder.log
|
|
|
|
|
|
# =============================================================================
|
|
# EXAMPLE: ICECAST STREAM SOURCE
|
|
# =============================================================================
|
|
[mystream]
|
|
# Source type (required): stream or soundcard
|
|
type = stream
|
|
|
|
# Stream URL (required for stream type)
|
|
url = http://example.com:8000/stream
|
|
|
|
# Authentication (optional - leave empty for public streams)
|
|
username =
|
|
password =
|
|
|
|
# Audio format: auto (detect from stream), mp3, ogg, aac, flac, opus
|
|
format = auto
|
|
|
|
# Override general settings for this source (optional):
|
|
# output_directory = recordings/streams
|
|
# split_minutes = 30
|
|
# filename_pattern = mystream_%Y%m%d_%H%M%S
|
|
|
|
|
|
# =============================================================================
|
|
# EXAMPLE: SOUNDCARD SOURCE (Linux)
|
|
# =============================================================================
|
|
# Uncomment and configure to record from a soundcard
|
|
#
|
|
# [stereo_mix]
|
|
# type = soundcard
|
|
#
|
|
# # Device selection (use one of these methods):
|
|
# # device = default - Use system default input device
|
|
# # device = monitor - Auto-select first monitor/loopback source (for system audio)
|
|
# # device = <name> - Match device by partial name (e.g., "Stereo Mix")
|
|
# # device = <id> - Use exact device ID from --list-devices
|
|
# #
|
|
# # To list available devices, run: python isr.py --list-devices
|
|
# device = default
|
|
#
|
|
# # Audio backend (only 'alsa' is supported):
|
|
# # backend = alsa
|
|
#
|
|
# # Sample rate in Hz (common: 44100, 48000, 96000)
|
|
# sample_rate = 44100
|
|
#
|
|
# # Number of audio channels (1 = mono, 2 = stereo)
|
|
# channels = 2
|
|
#
|
|
# # Output format: wav, flac
|
|
# format = wav
|
|
#
|
|
# # Override general settings for this source (optional):
|
|
# # output_directory = recordings/soundcard
|
|
# # split_minutes = 60
|
|
# # filename_pattern = soundcard_%Y%m%d_%H%M%S
|
|
|
|
|
|
# =============================================================================
|
|
# MULTIPLE SOURCES EXAMPLE
|
|
# =============================================================================
|
|
# You can define as many sources as you want. Each will record simultaneously.
|
|
#
|
|
# [radio_station_1]
|
|
# type = stream
|
|
# url = http://radio1.example.com:8000/live
|
|
# format = auto
|
|
# filename_pattern = radio1_%Y%m%d_%H%M%S
|
|
#
|
|
# [radio_station_2]
|
|
# type = stream
|
|
# url = http://radio2.example.com:8000/live
|
|
# format = auto
|
|
# filename_pattern = radio2_%Y%m%d_%H%M%S
|
|
#
|
|
# [system_audio]
|
|
# type = soundcard
|
|
# device = Stereo Mix
|
|
# sample_rate = 48000
|
|
# channels = 2
|
|
# format = flac
|
|
# filename_pattern = system_%Y%m%d_%H%M%S
|
|
|
|
|
|
# =============================================================================
|
|
# SOUNDCARD TIPS (Linux / Raspberry Pi)
|
|
# =============================================================================
|
|
# ISR uses ALSA (arecord) for soundcard recording. arecord is pre-installed
|
|
# on Raspberry Pi OS and most Linux distros (package: alsa-utils).
|
|
#
|
|
# Run: python isr.py --list-devices (or: arecord -l) to list devices.
|
|
#
|
|
# EASY: Use the "monitor" keyword to capture system/loopback audio:
|
|
# [system_audio]
|
|
# type = soundcard
|
|
# device = monitor
|
|
# format = wav
|
|
#
|
|
# MANUAL: Specify a device by ALSA hardware ID from --list-devices:
|
|
# [usb_mic]
|
|
# type = soundcard
|
|
# device = hw:1,0
|
|
# backend = alsa
|
|
# sample_rate = 44100
|
|
# channels = 2
|
|
# format = flac
|