diff --git a/previews.h b/previews.h index f180dfd..43db2c4 100644 --- a/previews.h +++ b/previews.h @@ -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), diff --git a/sh/prev/audio.sh b/sh/prev/audio.sh new file mode 100644 index 0000000..b4f2d82 --- /dev/null +++ b/sh/prev/audio.sh @@ -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