• In the System Preferences > Sound > Input, crank the input volume all the way up.
  • Install ffmpeg: brew install ffmpeg
  • Get the microphone’s device id: ffmpeg -f avfoundation -list_devices true -i ""
  • Run audio recording for 10 seconds: ffmpeg -f avfoundation -i ":DEVICE_ID" -t 10 audiocapture.mp3

Record forever in 6 hour intervals

1
2
3
4
5
6
7
8
9
#!/bin/bash
while true
do
    now=$(date +"%H-%M-%d-%m-%Y")
    duration="$((60 * 60 * 6))" # 6 hours
    # brew install ffmpeg
    /usr/local/bin/ffmpeg -f avfoundation -i ":2" -t duration "$now.m4a"
    sleep 1
done