Tag Parser  9.3.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
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 
6 namespace TagParser {
7 
9 public:
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)
36  , bytesPerSecond(0)
37  , chunkSize(0)
38  , bitsPerSample(0)
39  , channelMask(0)
40 {
41 }
42 
46 constexpr std::uint32_t WaveFormatHeader::bitrate() const
47 {
49 }
50 
52 public:
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 
60 protected:
61  void internalParseHeader(Diagnostics &diag) override;
62 
63 private:
64  std::uint64_t m_dataOffset;
65 };
66 
67 } // namespace TagParser
68 
69 #endif // TAG_PARSER_WAVEAUDIOSTREAM_H
TagParser::WaveFormatHeader::formatTag
std::uint16_t formatTag
Definition: waveaudiostream.h:18
TagParser::MatroskaTagIds::TrackSpecific::bitrate
constexpr TAG_PARSER_EXPORT const char * bitrate()
The track's bit rate in bits per second.
Definition: matroskatagid.h:460
TagParser::WaveFormatHeader
The WaveFormatHeader class parses the WAVEFORMATEX structure defined by MS.
Definition: waveaudiostream.h:8
TagParser::WaveFormatHeader::guid2
std::uint64_t guid2
Definition: waveaudiostream.h:17
TagParser::Diagnostics
The Diagnostics class is a container for DiagMessage.
Definition: diagnostics.h:156
TagParser
Contains all classes and functions of the TagInfo library.
Definition: aaccodebook.h:10
TagParser::WaveFormatHeader::sampleRate
std::uint32_t sampleRate
Definition: waveaudiostream.h:20
TagParser::TrackType
TrackType
Specifies the track type.
Definition: abstracttrack.h:27
TagParser::Mpeg4ChannelConfigs::channelCount
TAG_PARSER_EXPORT std::uint8_t channelCount(std::uint8_t config)
Returns the channel count for the specified MPEG-4 channel config.
Definition: mp4ids.cpp:460
TagParser::WaveFormatHeader::bitsPerSample
std::uint16_t bitsPerSample
Definition: waveaudiostream.h:23
TagParser::AbstractTrack
The AbstractTrack class parses and stores technical information about video, audio and other kinds of...
Definition: abstracttrack.h:39
TagParser::WaveFormatHeader::channelCount
std::uint16_t channelCount
Definition: waveaudiostream.h:19
TagParser::WaveFormatHeader::guid1
std::uint64_t guid1
Definition: waveaudiostream.h:16
TagParser::WaveAudioStream
Implementation of TagParser::AbstractTrack for the RIFF WAVE container format.
Definition: waveaudiostream.h:51
TagParser::WaveFormatHeader::chunkSize
std::uint16_t chunkSize
Definition: waveaudiostream.h:22
TagParser::WaveFormatHeader::bitrate
constexpr std::uint32_t bitrate() const
Calculates the bitrate from the header data.
Definition: waveaudiostream.h:46
TAG_PARSER_EXPORT
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
TagParser::WaveFormatHeader::WaveFormatHeader
constexpr WaveFormatHeader()
Constructs a new WaveFormatHeader.
Definition: waveaudiostream.h:30
TagParser::WaveFormatHeader::bytesPerSecond
std::uint32_t bytesPerSecond
Definition: waveaudiostream.h:21
TagParser::MediaFormat
The MediaFormat class specifies the format of media data.
Definition: mediaformat.h:245
TagParser::WaveFormatHeader::channelMask
std::uint32_t channelMask
Definition: waveaudiostream.h:24