opus tags
* differentiate Ogg Vorbis and Opus * read Opus tags
This commit is contained in:
parent
3fd3450875
commit
eed0d035f2
48
atom
48
atom
@ -679,6 +679,17 @@ getFiles() {
|
|||||||
EOWhere
|
EOWhere
|
||||||
then
|
then
|
||||||
mimetype=$(file -b --mime-type "$sourcepath/$filename")
|
mimetype=$(file -b --mime-type "$sourcepath/$filename")
|
||||||
|
if [[ $mimetype == application/ogg ]]
|
||||||
|
then
|
||||||
|
case "$(head -n1 "$sourcepath/$filename")" in
|
||||||
|
*'vorbis'*)
|
||||||
|
mimetype+=' vorbis'
|
||||||
|
;;
|
||||||
|
*'OpusHead'*)
|
||||||
|
mimetype+=' opus'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
mimetypeid=$(
|
mimetypeid=$(
|
||||||
InsertIfUnset mime_types <<-EOInsert
|
InsertIfUnset mime_types <<-EOInsert
|
||||||
mime_text $mimetype
|
mime_text $mimetype
|
||||||
@ -837,6 +848,36 @@ getInfos::Ogg() {
|
|||||||
bitrate=${bitrate%%,*}
|
bitrate=${bitrate%%,*}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getInfosOpus_version='Opus-1'
|
||||||
|
tagreaders+=( "$getInfosOpus_version" )
|
||||||
|
getInfos::Opus() {
|
||||||
|
tagreader="$getInfosOpus_version"
|
||||||
|
infos=$(
|
||||||
|
opusinfo "$sourcepath/$filename" \
|
||||||
|
| sed 's/\t//'
|
||||||
|
)
|
||||||
|
albumartist=$(gettag albumartist)
|
||||||
|
album=$(gettag album)
|
||||||
|
artist=$(gettag artist)
|
||||||
|
composer=$(gettag composer)
|
||||||
|
disc=$(gettag discnumber)
|
||||||
|
genre=$(gettag genre)
|
||||||
|
performer=$(gettag performer)
|
||||||
|
title=$(gettag title)
|
||||||
|
tracknum=$(gettag tracknumber)
|
||||||
|
tracktotal=$(gettag tracktotal)
|
||||||
|
if [ -n "$tracknum" -a -n "$tracktotal" ]
|
||||||
|
then
|
||||||
|
tracknum="$tracknum/$tracktotal"
|
||||||
|
fi
|
||||||
|
year=$(gettag date)
|
||||||
|
infos="${infos/: /=}"
|
||||||
|
rate=$(gettag 'original sample rate'|head -n1)
|
||||||
|
channels=$(gettag channels|head -n1)
|
||||||
|
bitrate=$(gettag 'average bitrate')
|
||||||
|
bitrate=${bitrate%%.*}
|
||||||
|
}
|
||||||
|
|
||||||
getInfosFLAC_version='FLAC-1'
|
getInfosFLAC_version='FLAC-1'
|
||||||
tagreaders+=( "$getInfosFLAC_version" )
|
tagreaders+=( "$getInfosFLAC_version" )
|
||||||
getInfos::FLAC() {
|
getInfos::FLAC() {
|
||||||
@ -943,7 +984,7 @@ tryAPE() {
|
|||||||
&& type=APE
|
&& type=APE
|
||||||
}
|
}
|
||||||
|
|
||||||
getTags_version='unknown-1'
|
getTags_version='unknown-2'
|
||||||
tagreaders+=( "$getTags_version" )
|
tagreaders+=( "$getTags_version" )
|
||||||
getTags() {
|
getTags() {
|
||||||
unset type
|
unset type
|
||||||
@ -951,7 +992,10 @@ getTags() {
|
|||||||
audio/mpeg)
|
audio/mpeg)
|
||||||
type=MP3
|
type=MP3
|
||||||
;;
|
;;
|
||||||
application/ogg)
|
'application/ogg opus')
|
||||||
|
type=Opus
|
||||||
|
;;
|
||||||
|
application/ogg*)
|
||||||
type=Ogg
|
type=Ogg
|
||||||
;;
|
;;
|
||||||
audio/x-flac)
|
audio/x-flac)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user