summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEkaitz Zarraga <ekaitz@elenq.tech>2023-10-15 19:06:56 +0200
committerEkaitz Zarraga <ekaitz@elenq.tech>2023-10-15 19:06:56 +0200
commit5d6932393a154f694d4abadb6a40353071232be3 (patch)
tree7ec0de4a62974cdf7a22d425cf9f918f0c8337b3
parent5e2abf1ad3707af22cfa1f2ef780f68e3a25a0f5 (diff)
aliases: easy audio recording ffmpeg
-rw-r--r--bash/dot-bash_aliases19
1 files changed, 19 insertions, 0 deletions
diff --git a/bash/dot-bash_aliases b/bash/dot-bash_aliases
index 247f096..51b3c3f 100644
--- a/bash/dot-bash_aliases
+++ b/bash/dot-bash_aliases
@@ -62,6 +62,25 @@ alias mail='vim +"set ft=markdown"'
alias yt-album-playlist='yt-dlp --ignore-errors --format bestaudio --extract-audio --audio-format mp3 --audio-quality 160K --parse-metadata "playlist_index:%(track_number)s" --add-metadata --embed-metadata --output "%(playlist_autonumber)02d - %(title)s.%(ext)s" --yes-playlist'
+# Easy audio recording
+alias audio_list_sources="pactl list short sources"
+function audio_record_from {
+ # https://trac.ffmpeg.org/wiki/Capture/PulseAudio
+ if ffmpeg -f pulse -i $1 -c:a libvorbis recording.ogg ; then
+ echo
+ echo Written output file to: recording.ogg
+ echo
+ fi
+}
+function audio_encode_vorbis {
+ local outfile="${2%.*}".ogg
+ if ffmpeg -i "$1" -vn -c:a libvorbis "${outfile}" ; then
+ echo
+ echo Written output file to: "${outfile}"
+ echo
+ fi
+}
+
# Wacom mapping
function wacom_map {
for i in $2; do