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;
143 m_istream->seekg(restHeaderLen, ios_base::cur);
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.
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. ...
static void addInfo(const MpegAudioFrame &frame, AbstractTrack &track)
Adds the information from the specified frame to the specified track.
uint32 xingFrameCount() const
Returns an indication whether the Xing frame count is present.
uint32 m_samplingFrequency
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.