Vorbis metadata:

* soxi is faster than ogginfo
* soxi provides bit-depth (as Precision)
This commit is contained in:
Vincent Riquer 2013-10-07 01:37:41 +02:00
parent e7a2c00f2b
commit 2dffcdb8b8
3 changed files with 21 additions and 14 deletions

9
atom
View File

@ -201,11 +201,18 @@ if ! which ogginfo >/dev/null
then then
echo "[WARNING] Tool ogginfo (from vorbis-tools) is not" \ echo "[WARNING] Tool ogginfo (from vorbis-tools) is not" \
"installed or not in PATH "installed or not in PATH
Vorbis metadata disabled
WebM metadata disabled" >&2 WebM metadata disabled" >&2
disableogginfo=1 disableogginfo=1
(( sanitywarn++ )) (( sanitywarn++ ))
fi 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 if (( oggencneeded )) && ! which oggenc >/dev/null
then then
echo "[WARNING] Tool oggenc (from vorbis-tools) is not" \ echo "[WARNING] Tool oggenc (from vorbis-tools) is not" \

View File

@ -12,8 +12,8 @@ getTags() {
(( disableopusinfo )) && unset type (( disableopusinfo )) && unset type
;; ;;
application/ogg*) application/ogg*)
type=Ogg type=soxi
(( disableogginfo )) && unset type (( disablesoxi )) && unset type
;; ;;
audio/x-flac) audio/x-flac)
type=FLAC type=FLAC

View File

@ -1,11 +1,10 @@
#!/bin/bash #!/bin/bash
getInfosOgg_version='Ogg-2' getInfosSoxi_version='soxi-1'
tagreaders+=( "$getInfosOgg_version" ) tagreaders+=( "$getInfosSoxi_version" )
getInfos::Ogg() { getInfos::soxi() {
tagreader="$getInfosOgg_version" tagreader="$getInfosSoxi_version"
infos=$( infos=$(
ogginfo "$sourcepath/$filename" \ soxi "$sourcepath/$filename"
| sed 's/\t//'
) )
albumartist=$(gettag albumartist) albumartist=$(gettag albumartist)
album=$(gettag album) album=$(gettag album)
@ -22,9 +21,10 @@ getInfos::Ogg() {
tracknum="$tracknum/$tracktotal" tracknum="$tracknum/$tracktotal"
fi fi
year=$(gettag date) year=$(gettag date)
infos="${infos//: /=}" infos="${infos//*( ): /=}"
rate=$(gettag rate|head -n1) rate=$(gettag 'sample rate')
channels=$(gettag channels|head -n1) channels=$(gettag channels)
bitrate=$(gettag 'average bitrate') bitrate=$(gettag 'bit rate')
bitrate=${bitrate%%,*} bitrate=${bitrate%%k}
bitdepth=$(gettag precision)
} }