Tag Parser 12.5.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
waveaudiostream.h
Go to the documentation of this file.
1#ifndef TAG_PARSER_WAVEAUDIOSTREAM_H
2#define TAG_PARSER_WAVEAUDIOSTREAM_H
3
4#include "../abstracttrack.h"
5
6namespace TagParser {
7
9public:
10 constexpr WaveFormatHeader();
11
12 std::uint64_t parse(CppUtilities::BinaryReader &reader, std::uint64_t maxSize, Diagnostics &diag);
13 MediaFormat format() const;
14 constexpr std::uint32_t bitrate() const;
15
16 std::uint64_t guid1;
17 std::uint64_t guid2;
18 std::uint16_t formatTag;
19 std::uint16_t channelCount;
20 std::uint32_t sampleRate;
21 std::uint32_t bytesPerSecond;
22 std::uint16_t chunkSize;
23 std::uint16_t bitsPerSample;
24 std::uint32_t channelMask;
25};
26
31 : guid1(0)
32 , guid2(0)
33 , formatTag(0)
34 , channelCount(0)
35 , sampleRate(0)
37 , chunkSize(0)
38 , bitsPerSample(0)
39 , channelMask(0)
40{
41}
42
46constexpr std::uint32_t WaveFormatHeader::bitrate() const
47{
49}
50
52public:
53 WaveAudioStream(std::iostream &stream, std::uint64_t startOffset);
54 ~WaveAudioStream() override;
55
56 TrackType type() const override;
57
58 static void addInfo(const WaveFormatHeader &waveHeader, AbstractTrack &track);
59
60protected:
61 void internalParseHeader(Diagnostics &diag, AbortableProgressFeedback &progress) override;
62
63private:
64 std::uint64_t m_dataOffset;
65};
66
67} // namespace TagParser
68
69#endif // TAG_PARSER_WAVEAUDIOSTREAM_H
The AbortableProgressFeedback class provides feedback about an ongoing operation via callbacks.
std::uint64_t startOffset() const
Returns the start offset of the track in the associated stream.
AbstractTrack(std::istream &inputStream, std::ostream &outputStream, std::uint64_t startOffset)
Constructs a new track.
The Diagnostics class is a container for DiagMessage.
The MediaFormat class specifies the format of media data.
TrackType type() const override
Returns the type of the track if known; otherwise returns TrackType::Unspecified.
static void addInfo(const WaveFormatHeader &waveHeader, AbstractTrack &track)
Adds the information from the specified waveHeader to the specified track.
WaveAudioStream(std::iostream &stream, std::uint64_t startOffset)
Constructs a new track for the stream at the specified startOffset.
void internalParseHeader(Diagnostics &diag, AbortableProgressFeedback &progress) override
This method is internally called to parse header information.
The WaveFormatHeader class parses the WAVEFORMATEX structure defined by MS.
MediaFormat format() const
Returns the media format denoted by the format tag.
constexpr std::uint32_t bitrate() const
Calculates the bitrate from the header data.
std::uint64_t parse(CppUtilities::BinaryReader &reader, std::uint64_t maxSize, Diagnostics &diag)
Parses the WAVE "fmt " header segment using the specified reader.
constexpr WaveFormatHeader()
Constructs a new WaveFormatHeader.
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
Definition global.h:14
Contains all classes and functions of the TagInfo library.
Definition aaccodebook.h:10
TrackType
The TrackType enum specifies the underlying file type of a track and the concrete class of the track ...