Advertisement
Guest User

Untitled

a guest
Nov 29th, 2020
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.78 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # README
  4. # run command to start recording then press Ctrl-C when you want to stop
  5. # recording.  This will create a new file in /tmp/ and then copy its path to
  6. # your clipboard You can then Ctrl+V to paste it into Anki, which will copy the
  7. # file to ~/.local/share/Anki2/
  8. #
  9. # to find the correct sink, use the following command to get the names of the
  10. # sinks. You MUST append the suffix ".monitor"
  11. #      pacmd list-sinks | grep -e '^[[:space:]]*name'
  12. #
  13. # On ubuntu, you will need to install the prerequisite packages
  14. #     sudo apt install pulseaudio-utils lame
  15.  
  16. sink=alsa_output.pci-0000_00_1b.0.analog-stereo.monitor
  17. file=/tmp/audio_$(date  "+%Y-%m-%d_%T").mp3
  18. parec -d $sink | lame -r -V6 - $file
  19. echo file://$file | xclip -t text/uri-list -selection clipboard
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement