Tag Parser 12.4.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
Loading...
Searching...
No Matches
TagParser::FlacMetaDataBlockStreamInfo Class Reference

The FlacMetaDataBlockStreamInfo class is a FLAC "METADATA_BLOCK_STREAMINFO" parser. More...

#include <flacmetadata.h>

Public Member Functions

constexpr FlacMetaDataBlockStreamInfo ()
 Constructs a new FLAC "METADATA_BLOCK_STREAMINFO".
 
void parse (std::string_view buffer)
 Parses the FLAC "METADATA_BLOCK_STREAMINFO" which is read using the specified iterator.
 
constexpr std::uint16_t minBlockSize () const
 Returns the minimum block size (in samples) used in the stream.
 
constexpr std::uint16_t maxBlockSize () const
 Returns the maximum block size (in samples) used in the stream.
 
constexpr std::uint32_t minFrameSize () const
 Returns the minimum frame size (in bytes) used in the stream.
 
constexpr std::uint32_t maxFrameSize () const
 The maximum frame size (in bytes) used in the stream.
 
constexpr std::uint32_t samplingFrequency () const
 Returns the sampling frequency in Hz.
 
constexpr std::uint8_t channelCount () const
 Returns the number of channels.
 
constexpr std::uint8_t bitsPerSample () const
 Returns the bits per sample.
 
constexpr std::uint64_t totalSampleCount () const
 Returns the total samples in stream.
 
constexpr const char * md5Sum () const
 Returns the MD5 signature of the unencoded audio data.
 

Detailed Description

The FlacMetaDataBlockStreamInfo class is a FLAC "METADATA_BLOCK_STREAMINFO" parser.

See also
https://xiph.org/flac/format.html

Constructor & Destructor Documentation

◆ FlacMetaDataBlockStreamInfo()

TagParser::FlacMetaDataBlockStreamInfo::FlacMetaDataBlockStreamInfo ( )
constexpr

Constructs a new FLAC "METADATA_BLOCK_STREAMINFO".

Definition at line 140 of file flacmetadata.h.

Member Function Documentation

◆ bitsPerSample()

std::uint8_t TagParser::FlacMetaDataBlockStreamInfo::bitsPerSample ( ) const
constexpr

Returns the bits per sample.

FLAC supports from 4 to 32 bits per sample. Currently the reference encoder and decoders only support up to 24 bits per sample.

Definition at line 219 of file flacmetadata.h.

◆ channelCount()

std::uint8_t TagParser::FlacMetaDataBlockStreamInfo::channelCount ( ) const
constexpr

Returns the number of channels.

FLAC supports from 1 to 8 channels .

Definition at line 207 of file flacmetadata.h.

◆ maxBlockSize()

std::uint16_t TagParser::FlacMetaDataBlockStreamInfo::maxBlockSize ( ) const
constexpr

Returns the maximum block size (in samples) used in the stream.

(Minimum blocksize == maximum blocksize) implies a fixed-blocksize stream.

Definition at line 166 of file flacmetadata.h.

◆ maxFrameSize()

std::uint32_t TagParser::FlacMetaDataBlockStreamInfo::maxFrameSize ( ) const
constexpr

The maximum frame size (in bytes) used in the stream.

May be 0 to imply the value is not known.

Definition at line 186 of file flacmetadata.h.

◆ md5Sum()

const char * TagParser::FlacMetaDataBlockStreamInfo::md5Sum ( ) const
constexpr

Returns the MD5 signature of the unencoded audio data.

This allows the decoder to determine if an error exists in the audio data even when the error does not result in an invalid bitstream.

Definition at line 243 of file flacmetadata.h.

◆ minBlockSize()

std::uint16_t TagParser::FlacMetaDataBlockStreamInfo::minBlockSize ( ) const
constexpr

Returns the minimum block size (in samples) used in the stream.

Definition at line 156 of file flacmetadata.h.

◆ minFrameSize()

std::uint32_t TagParser::FlacMetaDataBlockStreamInfo::minFrameSize ( ) const
constexpr

Returns the minimum frame size (in bytes) used in the stream.

May be 0 to imply the value is not known.

Definition at line 176 of file flacmetadata.h.

◆ parse()

void TagParser::FlacMetaDataBlockStreamInfo::parse ( std::string_view buffer)

Parses the FLAC "METADATA_BLOCK_STREAMINFO" which is read using the specified iterator.

Remarks
The specified buffer must be at least 0x22 bytes long.

Definition at line 58 of file flacmetadata.cpp.

◆ samplingFrequency()

std::uint32_t TagParser::FlacMetaDataBlockStreamInfo::samplingFrequency ( ) const
constexpr

Returns the sampling frequency in Hz.

Though 20 bits are available, the maximum sample rate is limited by the structure of frame headers to 655350Hz. Also, a value of 0 is invalid.

Definition at line 197 of file flacmetadata.h.

◆ totalSampleCount()

std::uint64_t TagParser::FlacMetaDataBlockStreamInfo::totalSampleCount ( ) const
constexpr

Returns the total samples in stream.

'Samples' means inter-channel sample, i.e. one second of 44.1Khz audio will have 44100 samples regardless of the number of channels.

A value of zero here means the number of total samples is unknown.

Definition at line 232 of file flacmetadata.h.


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