TagLib::AudioProperties Class Referenceabstract

A simple, abstract interface to common audio properties. More...

`#include <audioproperties.h>`

Inheritance diagram for TagLib::AudioProperties:
[legend]

## Public Types

enum | ReadStyle { Fast , Average , Accurate }

## Public Member Functions

virtual | ~AudioProperties ()
| AudioProperties (const AudioProperties &)=delete
AudioProperties & | operator= (const AudioProperties &)=delete
virtual TAGLIB_DEPRECATED int | length () const
virtual int | lengthInSeconds () const
virtual int | lengthInMilliseconds () const
virtual int | bitrate () const
virtual int | sampleRate () const
virtual int | channels () const =0

## Protected Member Functions

| AudioProperties (ReadStyle style)

## Detailed Description

A simple, abstract interface to common audio properties.

The values here are common to most audio formats. For more specific, codec dependent values, please see the subclasses APIs. This is meant to compliment the TagLib::File and TagLib::Tag APIs in providing a simple interface that is sufficient for most applications.

## Member Enumeration Documentation

## ReadStyle

enum TagLib::AudioProperties::ReadStyle

Reading audio properties from a file can sometimes be very time consuming and for the most accurate results can often involve reading the entire file. Because in many situations speed is critical or the accuracy of the values is not particularly important this allows the level of desired accuracy to be set.

Enumerator
Fast | Read as little of the file as possible.
Average | Read more of the file and make better values guesses.
Accurate | Read as much of the file as needed to report accurate values.

## Constructor & Destructor Documentation

## ~AudioProperties()

virtual TagLib::AudioProperties::~AudioProperties | ( |  | ) |

virtual

Destroys this AudioProperties instance.

## AudioProperties() [1/2]

TagLib::AudioProperties::AudioProperties | ( | const AudioProperties & |  | ) |

delete

References AudioProperties().

Referenced by AudioProperties(), and operator=().

## AudioProperties() [2/2]

TagLib::AudioProperties::AudioProperties | ( | ReadStyle | style | ) |

protected

Construct an audio properties instance. This is protected as this class should not be instantiated directly, but should be instantiated via its subclasses and can be fetched from the FileRef or File APIs.

See also
  ReadStyle

References TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE.

## Member Function Documentation

## bitrate()

virtual int TagLib::AudioProperties::bitrate | ( |  | ) | const

virtual

Returns the most appropriate bit rate for the file in kb/s. For constant bitrate formats this is simply the bitrate of the file. For variable bitrate formats this is either the average or nominal bitrate.

Reimplemented in TagLib::APE::Properties, TagLib::ASF::Properties, TagLib::DSDIFF::Properties, TagLib::DSF::Properties, TagLib::FLAC::Properties, TagLib::Matroska::Properties, TagLib::Mod::Properties, TagLib::MP4::Properties, TagLib::MPC::Properties, TagLib::MPEG::Properties, TagLib::Ogg::FLAC::Properties, TagLib::Ogg::Opus::Properties, TagLib::Ogg::Speex::Properties, TagLib::Ogg::Vorbis::Properties, TagLib::RIFF::AIFF::Properties, TagLib::RIFF::WAV::Properties, TagLib::Shorten::Properties, TagLib::TrueAudio::Properties, and TagLib::WavPack::Properties.

## channels()

virtual int TagLib::AudioProperties::channels | ( |  | ) | const

pure virtual

Returns the number of audio channels.

Implemented in TagLib::APE::Properties, TagLib::ASF::Properties, TagLib::DSDIFF::Properties, TagLib::DSF::Properties, TagLib::FLAC::Properties, TagLib::IT::Properties, TagLib::Matroska::Properties, TagLib::Mod::Properties, TagLib::MP4::Properties, TagLib::MPC::Properties, TagLib::MPEG::Properties, TagLib::Ogg::FLAC::Properties, TagLib::Ogg::Opus::Properties, TagLib::Ogg::Speex::Properties, TagLib::Ogg::Vorbis::Properties, TagLib::RIFF::AIFF::Properties, TagLib::RIFF::WAV::Properties, TagLib::S3M::Properties, TagLib::Shorten::Properties, TagLib::TrueAudio::Properties, TagLib::WavPack::Properties, and TagLib::XM::Properties.

## length()

virtual TAGLIB_DEPRECATED int TagLib::AudioProperties::length | ( |  | ) | const

virtual

Returns the length of the file in seconds. The length is rounded down to the nearest whole second.

Note
  This method is just an alias of lengthInSeconds().

Deprecated
  Use lengthInSeconds().

Referenced by TagLib::Matroska::Properties::File.

## lengthInMilliseconds()

virtual int TagLib::AudioProperties::lengthInMilliseconds | ( |  | ) | const

virtual

Returns the length of the file in milliseconds.

See also
  lengthInSeconds()

Reimplemented in TagLib::APE::Properties, TagLib::ASF::Properties, TagLib::DSDIFF::Properties, TagLib::DSF::Properties, TagLib::FLAC::Properties, TagLib::Matroska::Properties, TagLib::MP4::Properties, TagLib::MPC::Properties, TagLib::MPEG::Properties, TagLib::Ogg::FLAC::Properties, TagLib::Ogg::Opus::Properties, TagLib::Ogg::Speex::Properties, TagLib::Ogg::Vorbis::Properties, TagLib::RIFF::AIFF::Properties, TagLib::RIFF::WAV::Properties, TagLib::Shorten::Properties, TagLib::TrueAudio::Properties, and TagLib::WavPack::Properties.

## lengthInSeconds()

virtual int TagLib::AudioProperties::lengthInSeconds | ( |  | ) | const

virtual

Returns the length of the file in seconds. The length is rounded down to the nearest whole second.

See also
  lengthInMilliseconds()

Reimplemented in TagLib::DSDIFF::Properties, and TagLib::TrueAudio::Properties.

## operator=()

AudioProperties & TagLib::AudioProperties::operator= | ( | const AudioProperties & |  | ) |

delete

References AudioProperties(), and TAGLIB_DEPRECATED.

## sampleRate()

virtual int TagLib::AudioProperties::sampleRate | ( |  | ) | const

virtual

Returns the sample rate in Hz.

Reimplemented in TagLib::APE::Properties, TagLib::ASF::Properties, TagLib::DSDIFF::Properties, TagLib::DSF::Properties, TagLib::FLAC::Properties, TagLib::Matroska::Properties, TagLib::Mod::Properties, TagLib::MP4::Properties, TagLib::MPC::Properties, TagLib::MPEG::Properties, TagLib::Ogg::FLAC::Properties, TagLib::Ogg::Opus::Properties, TagLib::Ogg::Speex::Properties, TagLib::Ogg::Vorbis::Properties, TagLib::RIFF::AIFF::Properties, TagLib::RIFF::WAV::Properties, TagLib::Shorten::Properties, TagLib::TrueAudio::Properties, and TagLib::WavPack::Properties.

The documentation for this class was generated from the following file:

- audioproperties.h