Target formats can't handle 24bps

* read bit depth fron FLAC files
* downsample to 16
This commit is contained in:
Vincent Riquer 2013-09-09 01:16:27 +02:00
parent da4fe1c67a
commit cfc94d0a47
4 changed files with 13 additions and 1 deletions

4
atom
View File

@ -423,6 +423,7 @@ echo '
mime_type_actions.mime_text, mime_type_actions.mime_text,
destinations.name, destinations.name,
destination_files.id, destination_files.id,
tags.depth,
tags.rate, tags.rate,
tags.channels, tags.channels,
tags.bitrate, tags.bitrate,
@ -473,6 +474,8 @@ do
rest=${rest#*::AtOM:SQL:Sep::} rest=${rest#*::AtOM:SQL:Sep::}
destfileid=${rest%%::AtOM:SQL:Sep::*} destfileid=${rest%%::AtOM:SQL:Sep::*}
rest=${rest#*::AtOM:SQL:Sep::} rest=${rest#*::AtOM:SQL:Sep::}
bitdepth=${rest%%::AtOM:SQL:Sep::*}
rest=${rest#*::AtOM:SQL:Sep::}
rate=${rest%%::AtOM:SQL:Sep::*} rate=${rest%%::AtOM:SQL:Sep::*}
rest=${rest#*::AtOM:SQL:Sep::} rest=${rest#*::AtOM:SQL:Sep::}
channels=${rest%%::AtOM:SQL:Sep::*} channels=${rest%%::AtOM:SQL:Sep::*}
@ -517,6 +520,7 @@ do
album \ album \
albumartist \ albumartist \
artist \ artist \
bitdepth \
bitrate \ bitrate \
channels \ channels \
commandline \ commandline \

View File

@ -26,6 +26,11 @@ decodeSox() {
commandline+=(-c ${destinationchannels["$destination"]}) commandline+=(-c ${destinationchannels["$destination"]})
soxoptions_out+=" -c ${destinationchannels["$destination"]}" soxoptions_out+=" -c ${destinationchannels["$destination"]}"
fi fi
if (( ${bitdepth:-0} > 16 ))
then
commandline+=(-b 16)
soxoptions_out+=" -b 16"
fi
tmpfile="$fileid${soxoptions_in// /}${soxoptions_out// /}" tmpfile="$fileid${soxoptions_in// /}${soxoptions_out// /}"
commandline+=("$tempdir/$tmpfile.wav") commandline+=("$tempdir/$tmpfile.wav")
} }

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
getInfosFLAC_version='FLAC-1' getInfosFLAC_version='FLAC-2'
tagreaders+=( "$getInfosFLAC_version" ) tagreaders+=( "$getInfosFLAC_version" )
getInfos::FLAC() { getInfos::FLAC() {
tagreader="$getInfosFLAC_version" tagreader="$getInfosFLAC_version"
@ -36,10 +36,12 @@ getInfos::FLAC() {
{ {
read rate read rate
read channels read channels
read bitdepth
} < <( } < <(
metaflac \ metaflac \
--show-sample-rate \ --show-sample-rate \
--show-channels \ --show-channels \
--show-bps \
"$sourcepath/$filename" "$sourcepath/$filename"
) )
} }

View File

@ -52,6 +52,7 @@ CREATE TABLE IF NOT EXISTS tags (
title TEXT, title TEXT,
composer TEXT, composer TEXT,
performer TEXT, performer TEXT,
depth INTEGER,
rate INTEGER, rate INTEGER,
channels INTEGER, channels INTEGER,
bitrate INTEGER, bitrate INTEGER,