Files
MultiRoombaRover/rover/profiles/audioCapture.yaml
T
legop3 59911c1aae
Container image / image (push) Failing after 59s
profile updates
2026-11-17 21:14:02 -05:00

51 lines
2.5 KiB
YAML

- id: alsa
name: ALSA microphone (generic)
description: Uses the configured audio input device through roverd's ALSA conversion route.
setup: |
if ! command -v ffmpeg >/dev/null || ! command -v arecord >/dev/null; then
apt-get update && apt-get install -y ffmpeg alsa-utils
fi
run: |
sample_rate=48000
channels=2
bitrate=510000
arecord -D "$ROVER_AUDIO_INPUT_DEVICE" -f S32_LE -c "$channels" -r "$sample_rate" -B 16384 -F 1024 -q -t raw |
ffmpeg -nostdin -hide_banner -loglevel warning -fflags nobuffer \
-rtbufsize 0 -thread_queue_size 4096 -f s32le -ar "$sample_rate" -ac "$channels" -i pipe:0 \
-af "volume=20dB" -c:a libopus -b:a "$bitrate" -ar:a "$sample_rate" -ac:a "$channels" \
-application audio -frame_duration 20 -compression_level 0 \
-flush_packets 1 -muxdelay 0 -muxpreload 0 -f rtsp -rtsp_transport tcp "$ROVER_AUDIO_PUBLISH_URL"
- id: aiy
name: Google AIY Voice HAT microphone (raspberry pi)
description: HAT capture with S32_LE input, 20 dB microphone boost, and low-latency Opus settings. Reboot once after first enabling its hardware.
setup: |
set -euo pipefail
boot=/boot/firmware/config.txt
[[ -f "$boot" ]] || boot=/boot/config.txt
[[ -f "$boot" ]] || { echo 'AIY setup needs a Raspberry Pi boot config.txt' >&2; exit 1; }
changed=0
for setting in dtparam=i2s=on dtoverlay=googlevoicehat-soundcard; do
if ! grep -Fxq "$setting" "$boot"; then
# Leave any model-specific section before adding shared HAT settings.
if [[ "$changed" == 0 ]]; then printf '\n[all]\n' >> "$boot"; fi
printf '%s\n' "$setting" >> "$boot"
changed=1
fi
done
if [[ "$changed" == 1 ]]; then
echo 'AIY hardware enabled. Reboot the host once before using this sound card.'
fi
if ! command -v ffmpeg >/dev/null || ! command -v arecord >/dev/null; then
apt-get update && apt-get install -y ffmpeg alsa-utils
fi
run: |
sample_rate=48000
channels=2
bitrate=510000
arecord -D "$ROVER_AUDIO_INPUT_DEVICE" -f S32_LE -c "$channels" -r "$sample_rate" -B 16384 -F 1024 -q -t raw |
ffmpeg -nostdin -hide_banner -loglevel warning -fflags nobuffer \
-rtbufsize 0 -thread_queue_size 4096 -f s32le -ar "$sample_rate" -ac "$channels" -i pipe:0 \
-af "volume=20dB" -c:a libopus -b:a "$bitrate" -ar:a "$sample_rate" -ac:a "$channels" \
-application audio -frame_duration 20 -compression_level 0 \
-flush_packets 1 -muxdelay 0 -muxpreload 0 -f rtsp -rtsp_transport tcp "$ROVER_AUDIO_PUBLISH_URL"