forked from avTranscoder/avTranscoder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAudioReader.hpp
More file actions
54 lines (42 loc) · 1.43 KB
/
Copy pathAudioReader.hpp
File metadata and controls
54 lines (42 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef _AV_TRANSCODER_AUDIOREADER_HPP
#define _AV_TRANSCODER_AUDIOREADER_HPP
#include "IReader.hpp"
#include <AvTranscoder/file/InputFile.hpp>
#include <AvTranscoder/properties/AudioProperties.hpp>
namespace avtranscoder
{
class AvExport AudioReader : public IReader
{
public:
//@{
// @note Transform the input stream to s16 sample format (to listen).
// @see updateOutput
AudioReader(const InputStreamDesc& inputDesc);
//@}
~AudioReader();
/**
* @brief Update sample rate, number of channels and sample format of the output.
* @note Will transform the decoded data when read the stream.
*/
void updateOutput(const size_t sampleRate, const size_t nbChannels, const std::string& sampleFormat);
//@{
// @brief Output info
size_t getOutputSampleRate() const { return _outputSampleRate; }
size_t getOutputNbChannels() const { return _outputNbChannels; }
AVSampleFormat getOutputSampleFormat() const { return _outputSampleFormat; }
//@}
// @brief Get source audio properties
const AudioProperties* getSourceAudioProperties() const { return _audioStreamProperties; }
private:
void init();
private:
const AudioProperties* _audioStreamProperties; ///< Properties of the source audio stream read (no ownership, has link)
//@{
// @brief Output info
size_t _outputSampleRate;
size_t _outputNbChannels;
AVSampleFormat _outputSampleFormat;
//@}
};
}
#endif