Add audio preview

This commit is contained in:
Nikita Ivanov 2022-11-27 02:47:22 +01:00
parent 08095635bc
commit 486c69cccb
No known key found for this signature in database
GPG Key ID: 6E656AC5B97B5133
2 changed files with 13 additions and 0 deletions

View File

@ -42,6 +42,7 @@ Preview b_previews[] = {
PR(NULL, "image", NULL, image, PREV_ATTR_NONE),
PR(NULL, "image", "svg+xml", svg, PREV_ATTR_NONE),
PR(NULL, "video", NULL, video, PREV_ATTR_NONE),
PR(NULL, "audio", NULL, audio, PREV_ATTR_NONE),
PR(NULL, "application", "pdf", pdf, PREV_ATTR_NONE),
PR(NULL, "application", "json", jq, PREV_ATTR_NONE),

12
sh/prev/audio.sh Normal file
View File

@ -0,0 +1,12 @@
# audio: ffmpegthumbnailer ffmpeg
audio() {
ffmpegthumbnailer -i "$f" -s 0 -q 50% -t 10 -o "$cache_f" 2>/dev/null
}
x="$(ffmpeg -hide_banner -i "$f" 2>&1)"
printf '%s\n' "$x"
y=$((y + $(printf '%s\n' "$x" | wc -l)))
convert_and_show_image audio