3 #include "../mpegaudio/mpegaudioframestream.h" 5 #include "../exceptions.h" 6 #include "../mediaformat.h" 8 #include <c++utilities/conversion/stringconversion.h> 9 #include <c++utilities/io/binaryreader.h> 24 WaveFormatHeader::WaveFormatHeader()
110 const string context(
"parsing RIFF/WAVE header");
114 if (
m_reader.readUInt32BE() != 0x52494646u) {
118 if (
m_reader.readUInt32BE() != 0x57415645u) {
121 while (!m_dataOffset) {
122 uint32 segmentId =
m_reader.readUInt32BE();
123 uint32 restHeaderLen =
m_reader.readUInt32LE();
126 if (restHeaderLen >= 16u) {
130 restHeaderLen -= 16u;
136 m_dataOffset =
static_cast<uint64
>(
m_istream->tellg());
143 m_istream->seekg(restHeaderLen, ios_base::cur);
148 m_istream->seekg(static_cast<streamoff>(m_dataOffset));
153 ? ((
static_cast<double>(
m_size) * 8.0)
TAG_PARSER_EXPORT byte channelCount(byte config)
Returns the channel count for the specified MPEG-4 channel config.
uint32 sampleCount() const
Returns the sample count if known; otherwise returns 0.
IoUtilities::BinaryReader m_reader
~WaveAudioStream() override
Destroys the track.
void parseHeader(IoUtilities::BinaryReader &reader)
Parses the header read using the specified reader.
The MpegAudioFrame class is used to parse MPEG audio frames.
WaveAudioStream(std::iostream &stream, uint64 startOffset)
Constructs a new track for the stream at the specified startOffset.
static void addInfo(const WaveFormatHeader &waveHeader, AbstractTrack &track)
Adds the information from the specified waveHeader to the specified track.
bool isXingFramefieldPresent() const
Returns an indication whether the Xing frame field is present.
ChronoUtilities::TimeSpan m_duration
TrackType type() const override
Returns the type of the track if known; otherwise returns TrackType::Unspecified. ...
The exception that is thrown when the data to be parsed holds no parsable information.
static void addInfo(const MpegAudioFrame &frame, AbstractTrack &track)
Adds the information from the specified frame to the specified track.
The AbstractTrack class parses and stores technical information about video, audio and other kinds of...
uint32 xingFrameCount() const
Returns an indication whether the Xing frame count is present.
uint32 m_samplingFrequency
Contains all classes and functions of the TagInfo library.
TrackType
Specifies the track type.
uint32 bitrate() const
Returns the bitrate of the frame if known; otherwise returns 0.
uint32 samplingFrequency() const
Returns the sampeling frequency of the frame if known; otherwise returns 0.
void internalParseHeader(Diagnostics &diag) override
This method is internally called to parse header information.
The Diagnostics class is a container for DiagMessage.