Add DSD information to WavPack properties (#1303)

This commit is contained in:
Damien Plisson
2026-02-04 17:31:03 +01:00
committed by GitHub
parent 74d93db166
commit cf86f20b36
2 changed files with 12 additions and 0 deletions

View File

@ -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<int>(((flags & BYTES_STORED) + 1) * 8 - ((flags & SHIFT_MASK) >> SHIFT_LSB));
d->sampleRate = static_cast<int>(smplRate);
d->lossless = !(flags & HYBRID_FLAG);
d->dsd = (flags & DSD_FLAG) != 0;
d->sampleFrames = smplFrames;
}

View File

@ -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.
*/