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
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" \

View File

@ -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

View File

@ -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)
}