Tag Parser  6.2.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 WAVEAUDIOSTREAM_H
2 #define WAVEAUDIOSTREAM_H
3 
4 #include "../abstracttrack.h"
5 
6 namespace Media
7 {
8 
10 {
11 public:
13 
14  void parse(IoUtilities::BinaryReader &reader);
15  MediaFormat format() const;
16  uint32 bitrate() const;
17 
18  uint16 formatTag;
19  uint16 channelCount;
20  uint16 sampleRate;
22  uint16 chunkSize;
23  uint16 bitsPerSample;
24 };
25 
29 inline uint32 WaveFormatHeader::bitrate() const
30 {
31  return bitsPerSample * sampleRate * channelCount;
32 }
33 
35 {
36 public:
37  WaveAudioStream(std::iostream &stream, uint64 startOffset);
38  virtual ~WaveAudioStream();
39 
40  virtual TrackType type() const;
41 
42  static void addInfo(const WaveFormatHeader &waveHeader, AbstractTrack &track);
43 
44 protected:
45  virtual void internalParseHeader();
46 
47 private:
48  uint64 m_dataOffset;
49 };
50 
51 }
52 
53 #endif // WAVEAUDIOSTREAM_H
The WaveFormatHeader class parses the WAVEFORMATEX structure defined by MS.
TrackType
Specifies the track type.
Definition: abstracttrack.h:28
The AbstractTrack class parses and stores technical information about video, audio and other kinds of...
Definition: abstracttrack.h:40
Implementation of Media::AbstractTrack for the RIFF WAVE container format.
uint32 bitrate() const
Calculates the bitrate from the header data.
TAG_PARSER_EXPORT byte channelCount(byte config)
Returns the channel count for the specified MPEG-4 channel config.
Definition: mp4ids.cpp:342
Contains all classes and functions of the TagInfo library.
Definition: exceptions.h:9
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
The MediaFormat class specifies the format of media data.
Definition: mediaformat.h:256