-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaudioconv.h
40 lines (35 loc) · 946 Bytes
/
audioconv.h
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
#define __STDC_CONSTANT_MACROS
extern "C"
{
#include "libavfilter/avfilter.h"
#include "libavfilter/buffersrc.h"
#include "libavfilter/buffersink.h"
#include "libavformat/avformat.h"
#include "libavcodec/avcodec.h"
#include "libavutil/imgutils.h"
#include "libavutil/error.h"
#include "libavutil/avutil.h"
#include "libavutil/mathematics.h"
#include "libavutil/samplefmt.h"
#include "libavutil/frame.h"
#include "libavutil/opt.h"
}
#include "fileAudioEncoder.h"
#include "fileAudioDecoder.h"
#pragma once
class AudioTranscoder
{
private:
fileAudioDecoder *decoder;
fileAudioEncoder *encoder;
const char *inputFilePath;
AVCodecID codecID;
int firstFrame;
public:
AVCodecParameters *decodingParameters;
double duration;
AudioTranscoder(const char *input, AVCodecID codecID = AV_CODEC_ID_NONE);
int Init();
AVPacket *getPacket();
};
int convertAudioFile(const char *input, const char *output, const std::vector<AVCodecID> *codecIDs);