AvTranscoder  0.9.4
C++APIforLibav/FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AudioReader.hpp
Go to the documentation of this file.
1 #ifndef _AV_TRANSCODER_AUDIOREADER_HPP
2 #define _AV_TRANSCODER_AUDIOREADER_HPP
3 
4 #include "IReader.hpp"
5 
8 
9 namespace avtranscoder
10 {
11 
12 class AvExport AudioReader : public IReader
13 {
14 public:
15  //@{
16  // @note Transform the input stream to s16 sample format (to listen).
17  // @see updateOutput
18  AudioReader(const std::string& filename, const size_t streamIndex = 0, const int channelIndex = -1);
19  AudioReader(InputFile& inputFile, const size_t streamIndex = 0, const int channelIndex = -1);
20  //@}
21 
22  ~AudioReader();
23 
24  /**
25  * @brief Update sample rate, number of channels and sample format of the output.
26  * @note Will transform the decoded data when read the stream.
27  */
28  void updateOutput(const size_t sampleRate, const size_t nbChannels, const std::string& sampleFormat);
29 
30  //@{
31  // @brief Output info
32  size_t getOutputSampleRate() const { return _outputSampleRate; }
33  size_t getOutputNbChannels() const { return _outputNbChannels; }
34  AVSampleFormat getOutputSampleFormat() const { return _outputSampleFormat; }
35  //@}
36 
37  // @brief Get source audio properties
38  const AudioProperties* getSourceAudioProperties() const { return _audioStreamProperties; }
39 
40 private:
41  void init();
42 
43 private:
44  const AudioProperties* _audioStreamProperties; ///< Properties of the source audio stream read (no ownership, has link)
45 
46  //@{
47  // @brief Output info
50  AVSampleFormat _outputSampleFormat;
51  //@}
52 };
53 }
54 
55 #endif
Based class to read a stream.
Definition: IReader.hpp:18
AVSampleFormat _outputSampleFormat
Definition: AudioReader.hpp:50
AVSampleFormat getOutputSampleFormat() const
Definition: AudioReader.hpp:34
size_t getOutputNbChannels() const
Definition: AudioReader.hpp:33
const AudioProperties * _audioStreamProperties
Properties of the source audio stream read (no ownership, has link)
Definition: AudioReader.hpp:44
size_t getOutputSampleRate() const
Definition: AudioReader.hpp:32
const AudioProperties * getSourceAudioProperties() const
Definition: AudioReader.hpp:38
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy