From cf86f20b36ac070ed8511540057b1e448a82c6d3 Mon Sep 17 00:00:00 2001 From: Damien Plisson Date: Wed, 4 Feb 2026 17:31:03 +0100 Subject: [PATCH] Add DSD information to WavPack properties (#1303) --- taglib/wavpack/wavpackproperties.cpp | 7 +++++++ taglib/wavpack/wavpackproperties.h | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/taglib/wavpack/wavpackproperties.cpp b/taglib/wavpack/wavpackproperties.cpp index 34119402..3247da26 100644 --- a/taglib/wavpack/wavpackproperties.cpp +++ b/taglib/wavpack/wavpackproperties.cpp @@ -51,6 +51,7 @@ public: int version { 0 }; int bitsPerSample { 0 }; bool lossless { false }; + bool dsd { false }; unsigned int sampleFrames { 0 }; }; @@ -102,6 +103,11 @@ bool WavPack::Properties::isLossless() const return d->lossless; } +bool WavPack::Properties::isDsd() const +{ + return d->dsd; +} + unsigned int WavPack::Properties::sampleFrames() const { return d->sampleFrames; @@ -291,6 +297,7 @@ void WavPack::Properties::read(File *file, offset_t streamLength) d->bitsPerSample = static_cast(((flags & BYTES_STORED) + 1) * 8 - ((flags & SHIFT_MASK) >> SHIFT_LSB)); d->sampleRate = static_cast(smplRate); d->lossless = !(flags & HYBRID_FLAG); + d->dsd = (flags & DSD_FLAG) != 0; d->sampleFrames = smplFrames; } diff --git a/taglib/wavpack/wavpackproperties.h b/taglib/wavpack/wavpackproperties.h index d01c1b63..ad45e909 100644 --- a/taglib/wavpack/wavpackproperties.h +++ b/taglib/wavpack/wavpackproperties.h @@ -96,6 +96,11 @@ namespace TagLib { */ bool isLossless() const; + /*! + * Returns whether or not the file is DSD (not PCM) + */ + bool isDsd() const; + /*! * Returns the total number of audio samples in file. */