TagLib API Documentation
TagLib::ID3v2::SynchData Namespace Reference

A few functions for ID3v2 synch safe integer conversion. More...


TAGLIB_EXPORT unsigned int toUInt (const ByteVector &data)
TAGLIB_EXPORT ByteVector fromUInt (unsigned int value)
TAGLIB_EXPORT ByteVector decode (const ByteVector &data)

Detailed Description

A few functions for ID3v2 synch safe integer conversion.

In the ID3v2.4 standard most integer values are encoded as "synch safe" integers which are encoded in such a way that they will not give false MPEG syncs and confuse MPEG decoders. This namespace provides some methods for converting to and from these values to ByteVectors for things rendering and parsing ID3v2 data.

Function Documentation

◆ decode()

TAGLIB_EXPORT ByteVector TagLib::ID3v2::SynchData::decode ( const ByteVector data)

Convert the data from unsynchronized data to its original format.

◆ fromUInt()

TAGLIB_EXPORT ByteVector TagLib::ID3v2::SynchData::fromUInt ( unsigned int  value)

Returns a 4 byte (32 bit) synchsafe integer based on value.

◆ toUInt()

TAGLIB_EXPORT unsigned int TagLib::ID3v2::SynchData::toUInt ( const ByteVector data)

This returns the unsigned integer value of data where data is a ByteVector that contains a synchsafe integer (id3v2.4.0-structure.txt, 6.2). The default length of 4 is used if another value is not specified.