Advertisement
Tbruff13

Untitled

Sep 28th, 2011
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. WAV="$1"
  2. if [ -z "$WAV" ]; then
  3. echo "Usage: $0 OUTPUT.WAV" >&2
  4. exit 1
  5. fi
  6. rm -f "$WAV"
  7.  
  8. # Get sink monitor:
  9. MONITOR=$(pactl list | grep -A2 '^Source #' | \
  10. grep 'Name: .*\.monitor$' | awk '{print $NF}' | tail -n1)
  11.  
  12. # Record it raw, and convert to a wav
  13. echo "Recording to $WAV ..."
  14. echo "Ctrl-C or Close this window to stop"
  15. parec -d "$MONITOR" | sox -t raw -r 44100 -sLb 16 -c 2 - "$WAV"
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement