diff --git a/atom b/atom index 8fcf787..8e2db2c 100755 --- a/atom +++ b/atom @@ -201,11 +201,18 @@ if ! which ogginfo >/dev/null then echo "[WARNING] Tool ogginfo (from vorbis-tools) is not" \ "installed or not in PATH - Vorbis metadata disabled WebM metadata disabled" >&2 disableogginfo=1 (( sanitywarn++ )) fi +if ! which soxi >/dev/null +then + echo "[WARNING] Tool soxi (from sox) is not" \ + "installed or not in PATH + Vorbis metadata disabled" >&2 + disablesoxi=1 + (( sanitywarn++ )) +fi if (( oggencneeded )) && ! which oggenc >/dev/null then echo "[WARNING] Tool oggenc (from vorbis-tools) is not" \ diff --git a/lib/tags/gettags b/lib/tags/gettags index dcaa0e9..2556140 100644 --- a/lib/tags/gettags +++ b/lib/tags/gettags @@ -12,8 +12,8 @@ getTags() { (( disableopusinfo )) && unset type ;; application/ogg*) - type=Ogg - (( disableogginfo )) && unset type + type=soxi + (( disablesoxi )) && unset type ;; audio/x-flac) type=FLAC diff --git a/lib/tags/ogg b/lib/tags/soxi similarity index 56% rename from lib/tags/ogg rename to lib/tags/soxi index 658c3ab..606bfc0 100644 --- a/lib/tags/ogg +++ b/lib/tags/soxi @@ -1,11 +1,10 @@ #!/bin/bash -getInfosOgg_version='Ogg-2' -tagreaders+=( "$getInfosOgg_version" ) -getInfos::Ogg() { - tagreader="$getInfosOgg_version" +getInfosSoxi_version='soxi-1' +tagreaders+=( "$getInfosSoxi_version" ) +getInfos::soxi() { + tagreader="$getInfosSoxi_version" infos=$( - ogginfo "$sourcepath/$filename" \ - | sed 's/\t//' + soxi "$sourcepath/$filename" ) albumartist=$(gettag albumartist) album=$(gettag album) @@ -22,9 +21,10 @@ getInfos::Ogg() { tracknum="$tracknum/$tracktotal" fi year=$(gettag date) - infos="${infos//: /=}" - rate=$(gettag rate|head -n1) - channels=$(gettag channels|head -n1) - bitrate=$(gettag 'average bitrate') - bitrate=${bitrate%%,*} + infos="${infos//*( ): /=}" + rate=$(gettag 'sample rate') + channels=$(gettag channels) + bitrate=$(gettag 'bit rate') + bitrate=${bitrate%%k} + bitdepth=$(gettag precision) }