forked from Shinonome/dots-hyprland
music recognition script fix from main
This commit is contained in:
@@ -18,7 +18,7 @@ while getopts "i:t:s:" opt; do
|
||||
done
|
||||
if [ "$SOURCE_TYPE" = "monitor" ]; then
|
||||
MONITOR_SOURCE=$(pactl get-default-sink).monitor
|
||||
elif [ "$SOURCE_TYPE" = "input" ]; then
|
||||
elif [ "$SOURCE_TYPE" = "input" ]; then
|
||||
MONITOR_SOURCE=$(pactl info | grep "Default Source:" | awk '{print $3}' || true)
|
||||
else
|
||||
echo "Invalid source type"
|
||||
@@ -53,7 +53,7 @@ while true; do
|
||||
fi
|
||||
|
||||
ffmpeg -f s16le -ar 44100 -ac 2 -i "$TMP_RAW" -acodec libmp3lame -y -hide_banner -loglevel error "$TMP_MP3" 2>/dev/null
|
||||
RESULT=$(songrec audio-file-to-recognized-song "$TMP_MP3" 2>/dev/null || true)
|
||||
RESULT=$(songrec recognize --json "$TMP_MP3" 2>/dev/null || true)
|
||||
|
||||
if echo "$RESULT" | grep -q '"matches": \[' && [ ${#RESULT} -gt $MIN_VALID_RESULT_LENGTH ]; then
|
||||
echo "$RESULT"
|
||||
|
||||
Reference in New Issue
Block a user