From 5d6932393a154f694d4abadb6a40353071232be3 Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Sun, 15 Oct 2023 19:06:56 +0200 Subject: aliases: easy audio recording ffmpeg --- bash/dot-bash_aliases | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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 -- cgit v1.2.3