Tag Parser 12.3.1
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
Loading...
Searching...
No Matches
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
8class TAG_PARSER_EXPORT WaveFormatHeader {
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)
36 , bytesPerSecond(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.
The AbstractTrack class parses and stores technical information about video, audio and other kinds of...
The Diagnostics class is a container for DiagMessage.
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.
Definition global.h:14
constexpr TAG_PARSER_EXPORT std::string_view bitrate()
The track's bit rate in bits per second.
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 ...