Skip to content

Instantly share code, notes, and snippets.

@ArtBIT
Last active June 17, 2016 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ArtBIT/c0702cf5e9ab3524f98beec976ebbfcd to your computer and use it in GitHub Desktop.
Save ArtBIT/c0702cf5e9ab3524f98beec976ebbfcd to your computer and use it in GitHub Desktop.
Record sounds from the HAL9000 microphone ans save them to /home/pi/recordings
#!/bin/bash
FILE=/tmp/mic.wav
arecord \
-D plughw:0 \
-f cd \
> $FILE
TARGET_DIR="${HOME}/recordings"
if [ ! -d "$TARGET_DIR" ]; then
mkdir -p "$TARGET_DIR"
fi
cp $FILE $TARGET_DIR/$(date +\%Y\%m\%d\%H\%M).wav
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment