Tag Parser  10.0.1
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, AbortableProgressFeedback &progress) override;
62 
63 private:
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.
The AbstractTrack class parses and stores technical information about video, audio and other kinds of...
Definition: abstracttrack.h:65
The Diagnostics class is a container for DiagMessage.
Definition: diagnostics.h:156
The MediaFormat class specifies the format of media data.
Definition: mediaformat.h:246
Implementation of TagParser::AbstractTrack for the RIFF WAVE container format.
The WaveFormatHeader class parses the WAVEFORMATEX structure defined by MS.
constexpr std::uint32_t bitrate() const
Calculates the bitrate from the header data.
constexpr WaveFormatHeader()
Constructs a new WaveFormatHeader.
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
constexpr TAG_PARSER_EXPORT std::string_view bitrate()
The track's bit rate in bits per second.
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
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 ...
Definition: abstracttrack.h:31