From 6c7c762857ae8fe6c01a7dd647b67368c364ca27 Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Sun, 18 Jun 2023 08:33:15 -0400 Subject: [PATCH] msrec: added script --- src/.config/fish/aliases.fish | 2 + src/.local/bin/msrec | 69 +++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100755 src/.local/bin/msrec diff --git a/src/.config/fish/aliases.fish b/src/.config/fish/aliases.fish index 6ed1e58..06ef3ea 100644 --- a/src/.config/fish/aliases.fish +++ b/src/.config/fish/aliases.fish @@ -41,6 +41,8 @@ alias units='units -H ""' alias sxiv='nsxiv' # music recognition +# an alternative is available at ~/.local/bin/msrec +# which uses a different service function musrec # if file exists if test -e $argv diff --git a/src/.local/bin/msrec b/src/.local/bin/msrec new file mode 100755 index 0000000..e811cd6 --- /dev/null +++ b/src/.local/bin/msrec @@ -0,0 +1,69 @@ +#!/bin/sh +# https://docs.acrcloud.com/reference/identification-api + +# put your access key and access secret on two lines in ~/.config/acr_token +# usage: +# +# msrec file.mp4 +# + +set -e + +TMPF="$(mktemp --suffix .mp3)" + +ffmpeg -y -i $1 "$TMPF" + +c=`cat <