mirror of
https://github.com/taglib/taglib.git
synced 2026-06-07 14:59:24 -04:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de6e2b15c8 | ||
|
|
b7f0225f0d | ||
|
|
f4117f873c | ||
|
|
cf86f20b36 |
@@ -3,6 +3,7 @@ TagLib 2.2 (Feb 18, 2026)
|
||||
|
||||
* Support for Matroska (MKA, MKV) and WebM files.
|
||||
* Support for NI STEM in MP4 files.
|
||||
* New method isDsd() in WavPack Properties.
|
||||
* Stricter verification of ID3v2 frames.
|
||||
* Fix setting the last header flag in Ogg FLAC files.
|
||||
* Fix reading of the last page in Ogg streams.
|
||||
|
||||
@@ -12,7 +12,7 @@ include(CMakePackageConfigHelpers)
|
||||
|
||||
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
|
||||
if(APPLE)
|
||||
option(BUILD_FRAMEWORK "Build an OS X framework" OFF)
|
||||
option(BUILD_FRAMEWORK "Build a macOS framework" OFF)
|
||||
if(BUILD_FRAMEWORK)
|
||||
set(BUILD_SHARED_LIBS ON)
|
||||
#set(CMAKE_MACOSX_RPATH 1)
|
||||
|
||||
@@ -63,13 +63,13 @@ and ID3 tags cannot be disabled. The following CMake options are available:
|
||||
| `WITH_APE` | Build with APE, MPC, WavPack (default ON) |
|
||||
| `WITH_ASF` | Build with ASF (default ON) |
|
||||
| `WITH_DSF` | Build with DSF (default ON) |
|
||||
| `WITH_MATROSKA` | Build with Matroska (default ON) |
|
||||
| `WITH_MATROSKA` | Build with Matroska, WebM (default ON) |
|
||||
| `WITH_MOD` | Build with Tracker modules (default ON) |
|
||||
| `WITH_MP4` | Build with MP4 (default ON) |
|
||||
| `WITH_RIFF` | Build with AIFF, RIFF, WAV (default ON) |
|
||||
| `WITH_SHORTEN` | Build with Shorten (default ON) |
|
||||
| `WITH_TRUEAUDIO` | Build with TrueAudio (default ON) |
|
||||
| `WITH_VORBIS` | Build with Vorbis, FLAC, Ogg, Opus (default ON) |
|
||||
| `WITH_VORBIS` | Build with FLAC, Ogg, Opus, Speex (default ON) |
|
||||
|
||||
Note that disabling formats will remove exported symbols from the library and
|
||||
thus break binary compatibility. These options should therefore only be used
|
||||
|
||||
24
README.md
24
README.md
@@ -7,10 +7,11 @@
|
||||
https://taglib.org/
|
||||
|
||||
TagLib is a library for reading and editing the metadata of several
|
||||
popular audio formats. Currently, it supports both ID3v1 and ID3v2
|
||||
for MP3 files, [Ogg Vorbis][] comments and ID3 tags
|
||||
in [FLAC][], MPC, Speex, WavPack, TrueAudio, WAV, AIFF, MP4, APE, ASF,
|
||||
DSF, DFF and AAC files.
|
||||
popular audio formats. Currently, it supports various metadata containers such
|
||||
as [ID3v1][], [ID3v2][] and [Vorbis][] comments for MP3, MP4, AAC,
|
||||
[Ogg][], [Opus][], [FLAC][], [Speex][], [APE][], [MPC][], [WavPack][],
|
||||
[WAV][], [AIFF][], [TrueAudio][], [Matroska][], [WebM][], ASF, WMA, DSF, DFF and
|
||||
tracker (MOD, XM, S3M, IT) files.
|
||||
|
||||
TagLib is distributed under the [GNU Lesser General Public License][]
|
||||
(LGPL) and [Mozilla Public License][] (MPL). Essentially that means that
|
||||
@@ -18,7 +19,20 @@ it may be used in proprietary applications, but if changes are made to
|
||||
TagLib they must be contributed back to the project. Please review the
|
||||
licenses if you are considering using TagLib in your project.
|
||||
|
||||
[Ogg Vorbis]: https://xiph.org/vorbis/
|
||||
[ID3v1]: https://id3.org/ID3v1
|
||||
[ID3v2]: https://id3.org/Home
|
||||
[Vorbis]: https://xiph.org/vorbis/
|
||||
[Ogg]: https://www.xiph.org/ogg/
|
||||
[Opus]: https://opus-codec.org/
|
||||
[FLAC]: https://xiph.org/flac/
|
||||
[Speex]: https://www.speex.org/
|
||||
[APE]: https://www.monkeysaudio.com/
|
||||
[MPC]: https://musepack.net/
|
||||
[WavPack]: https://www.wavpack.com/
|
||||
[WAV]: https://www.mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html
|
||||
[AIFF]: https://www.mmsp.ece.mcgill.ca/Documents/AudioFormats/AIFF/AIFF.html
|
||||
[TrueAudio]: https://sourceforge.net/projects/tta/
|
||||
[Matroska]: https://www.matroska.org/
|
||||
[WebM]: https://www.webmproject.org/
|
||||
[GNU Lesser General Public License]: https://www.gnu.org/licenses/lgpl.html
|
||||
[Mozilla Public License]: https://www.mozilla.org/MPL/MPL-1.1.html
|
||||
|
||||
@@ -25,11 +25,14 @@
|
||||
#include "tfile.h"
|
||||
#include "matroskaproperties.h"
|
||||
|
||||
//! An implementation of Matroska metadata
|
||||
namespace TagLib::Matroska {
|
||||
class Tag;
|
||||
class Attachments;
|
||||
class Chapters;
|
||||
|
||||
//! An implementation of TagLib::File with Matroska specific methods
|
||||
|
||||
/*!
|
||||
* Implementation of TagLib::File for Matroska.
|
||||
*/
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "tbytevectorlist.h"
|
||||
#include "tdebug.h"
|
||||
#include "tpropertymap.h"
|
||||
#include "unknownframe.h"
|
||||
|
||||
using namespace TagLib;
|
||||
using namespace ID3v2;
|
||||
@@ -259,7 +260,7 @@ void ChapterFrame::parseFields(const ByteVector &data)
|
||||
return;
|
||||
|
||||
// Checks to make sure that frame parsed correctly.
|
||||
if(frame->size() <= 0) {
|
||||
if(frame->size() <= 0 || dynamic_cast<UnknownFrame *>(frame)) {
|
||||
delete frame;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
#include "tpropertymap.h"
|
||||
#include "tdebug.h"
|
||||
#include "unknownframe.h"
|
||||
|
||||
using namespace TagLib;
|
||||
using namespace ID3v2;
|
||||
@@ -269,7 +270,7 @@ void TableOfContentsFrame::parseFields(const ByteVector &data)
|
||||
return;
|
||||
|
||||
// Checks to make sure that frame parsed correctly.
|
||||
if(frame->size() <= 0) {
|
||||
if(frame->size() <= 0 || dynamic_cast<UnknownFrame *>(frame)) {
|
||||
delete frame;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -77,7 +77,8 @@ namespace TagLib {
|
||||
* - A clean, high level, C++ API for handling audio metadata.
|
||||
* - Format specific APIs for advanced API users.
|
||||
* - ID3v1, ID3v2, APE, FLAC, Xiph, iTunes-style MP4 and WMA tag formats.
|
||||
* - MP3, MPC, FLAC, MP4, ASF, AIFF, WAV, DSF, DFF, TrueAudio, WavPack, Ogg FLAC, Ogg Vorbis, Speex and Opus file formats.
|
||||
* - MP3, MPC, FLAC, MP4, ASF, AIFF, WAV, DSF, DFF, TrueAudio, WavPack, Ogg FLAC, Ogg Vorbis, Speex,
|
||||
* Opus, Matroska and WebM file formats.
|
||||
* - Basic audio file properties such as length, sample rate, etc.
|
||||
* - Long term binary and source compatibility.
|
||||
* - Extensible design, notably the ability to add other formats or extend current formats as a library user.
|
||||
|
||||
@@ -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;
|
||||
@@ -254,16 +260,16 @@ void WavPack::Properties::read(File *file, offset_t streamLength)
|
||||
const unsigned int flags = data.toUInt(24, false);
|
||||
unsigned int smplRate = sampleRates[(flags & SRATE_MASK) >> SRATE_LSB];
|
||||
|
||||
if(!blockSamples) { // ignore blocks with no samples
|
||||
offset += blockSize + 8;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(blockSize < 24 || blockSize > 1048576) {
|
||||
debug("WavPack::Properties::read() -- Invalid block header found.");
|
||||
break;
|
||||
}
|
||||
|
||||
if(!blockSamples) { // ignore blocks with no samples
|
||||
offset += blockSize + 8;
|
||||
continue;
|
||||
}
|
||||
|
||||
// For non-standard sample rates or DSD audio files, we must read and parse the block
|
||||
// to actually determine the sample rate.
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user