Tag Parser  8.2.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  void parse(IoUtilities::BinaryReader &reader);
13  std::pair<MediaFormat, uint64> parseExt(IoUtilities::BinaryReader &reader, uint64 maxSize, Diagnostics &diag);
14  MediaFormat format() const;
15  constexpr uint32 bitrate() const;
16 
17  uint16 formatTag;
18  uint16 channelCount;
19  uint16 sampleRate;
21  uint16 chunkSize;
22  uint16 bitsPerSample;
23 };
24 
29  : formatTag(0)
30  , channelCount(0)
31  , sampleRate(0)
32  , bytesPerSecond(0)
33  , chunkSize(0)
34  , bitsPerSample(0)
35 {
36 }
37 
41 constexpr uint32 WaveFormatHeader::bitrate() const
42 {
44 }
45 
47 public:
48  WaveAudioStream(std::iostream &stream, uint64 startOffset);
49  ~WaveAudioStream() override;
50 
51  TrackType type() const override;
52 
53  static void addInfo(const WaveFormatHeader &waveHeader, AbstractTrack &track);
54 
55 protected:
56  void internalParseHeader(Diagnostics &diag) override;
57 
58 private:
59  uint64 m_dataOffset;
60 };
61 
62 } // namespace TagParser
63 
64 #endif // TAG_PARSER_WAVEAUDIOSTREAM_H
TAG_PARSER_EXPORT byte channelCount(byte config)
Returns the channel count for the specified MPEG-4 channel config.
Definition: mp4ids.cpp:452
Implementation of TagParser::AbstractTrack for the RIFF WAVE container format.
constexpr WaveFormatHeader()
Constructs a new WaveFormatHeader.
The MediaFormat class specifies the format of media data.
Definition: mediaformat.h:244
The WaveFormatHeader class parses the WAVEFORMATEX structure defined by MS.
constexpr TAG_PARSER_EXPORT const char * bitrate()
The track's bit rate in bits per second.
The AbstractTrack class parses and stores technical information about video, audio and other kinds of...
Definition: abstracttrack.h:40
Contains all classes and functions of the TagInfo library.
Definition: aaccodebook.h:9
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
TrackType
Specifies the track type.
Definition: abstracttrack.h:28
constexpr uint32 bitrate() const
Calculates the bitrate from the header data.
The Diagnostics class is a container for DiagMessage.
Definition: diagnostics.h:156