From 9de0763967ffab9bc06cf78e79561cfc28cfe0e8 Mon Sep 17 00:00:00 2001 From: Bart Lauret Date: Sun, 27 Sep 2020 15:32:12 +0200 Subject: [PATCH] Add support for DSD WavPack From version 5.0 WavPack supports DSD-encoded WavPacks. To play these files use the DSDPlayer plugin. Patch authored by Kimmo Taskinen --- Slim/Formats.pm | 8 ++++++++ Slim/Formats/WavPack.pm | 4 ++++ convert.conf | 4 ++++ strings.txt | 37 ++++++++++++++++++++++++++----------- types.conf | 1 + 5 files changed, 43 insertions(+), 11 deletions(-) diff --git a/Slim/Formats.pm b/Slim/Formats.pm index 4de53777147..306e64182f0 100644 --- a/Slim/Formats.pm +++ b/Slim/Formats.pm @@ -86,6 +86,10 @@ sub init { $tagClasses{'dsf'} = 'Slim::Formats::DSF'; } + if (Slim::Utils::Versions->compareVersions($Audio::Scan::VERSION,'0.99') >= 0) { + $tagClasses{'wvpx'} = 'Slim::Formats::WavPack'; + } + if (Slim::Utils::Versions->compareVersions($Audio::Scan::VERSION, '1.02') >= 0) { $tagClasses{'ops'} = 'Slim::Formats::OggOpus'; } @@ -261,6 +265,10 @@ sub readTags { $tags->{'CONTENT_TYPE'} = 'alcx' if ($tags->{'CONTENT_TYPE'} eq 'alc') } + if ($tags->{'WAVPACKDSD'}) { + $type = 'wvpx'; + } + # Only set if we couldn't read it from the file. $tags->{'CONTENT_TYPE'} ||= $type; diff --git a/Slim/Formats/WavPack.pm b/Slim/Formats/WavPack.pm index 86e77686d7d..b8b66e95006 100644 --- a/Slim/Formats/WavPack.pm +++ b/Slim/Formats/WavPack.pm @@ -29,6 +29,10 @@ sub getTag { $tags->{CHANNELS} = $info->{channels}; $tags->{VBR_SCALE} = 1; + if ( $info->{bits_per_sample} == 1 ) { + $tags->{WAVPACKDSD} = 1; + } + Slim::Formats::APE->doTagMapping($tags); return $tags; diff --git a/convert.conf b/convert.conf index 8bc5f448a91..8b65d5661e7 100644 --- a/convert.conf +++ b/convert.conf @@ -373,3 +373,7 @@ dsf dsf * * dff dff * * # IFD - + +wvpx wvpx * * + # IFD + - diff --git a/strings.txt b/strings.txt index 020c28b8aa8..593d981d38e 100644 --- a/strings.txt +++ b/strings.txt @@ -11766,20 +11766,35 @@ MPC SV Musepack WVP - CS Wavpack - DA Wavpack - DE Wavpack - EN Wavpack - ES Wavpack + CS WavPack + DA WavPack + DE WavPack + EN WavPack + ES WavPack FI WavPack - FR Wavpack - IT Wavpack - NL Wavpack - NO Wavpack - PL Wavpack - RU Wavpack + FR WavPack + IT WavPack + NL WavPack + NO WavPack + PL WavPack + RU WavPack SV WavPack +WVPX + CS WavPack DSD + DA WavPack DSD + DE WavPack DSD + EN WavPack DSD + ES WavPack DSD + FI WavPack DSD + FR WavPack DSD + IT WavPack DSD + NL WavPack DSD + NO WavPack DSD + PL WavPack DSD + RU WavPack DSD + SV WavPack DSD + SHN # SLT: Please note that "Shorten" is a file format name, thus doesn't need to be translated EN Shorten diff --git a/types.conf b/types.conf index d928522e5ed..67edc5a9805 100644 --- a/types.conf +++ b/types.conf @@ -57,6 +57,7 @@ wmal - audio/x-wma-lossless audio wmap - audio/x-wma-wmapro audio wpl wpl application/vnd.ms-wpl playlist wvp wv audio/x-wavpack audio +wvpx - audio/x-wavpack audio xml xml,xsl text/xml - xpf xspf application/xspf+xml playlist xul xul application/vnd.mozilla.xul+xml -