-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMP3Processor.h
More file actions
29 lines (25 loc) · 789 Bytes
/
Copy pathMP3Processor.h
File metadata and controls
29 lines (25 loc) · 789 Bytes
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
#pragma once
#include "RingBuffer.h"
#include <atomic>
#include <vector>
class MP3Processor {
public:
MP3Processor() noexcept;
~MP3Processor() noexcept;
size_t getWorkBufferSize() const noexcept;
bool init(const int, const int, const int) noexcept;
void deInit() noexcept;
void addNextInput(float *) noexcept;
bool buffered(const double) const noexcept;
bool hasReadyOutput(const size_t) const noexcept;
size_t getNextOutput(float *, const size_t) noexcept;
private:
std::atomic_bool bInitialized{};
void *lame_enc_handler = nullptr;
void *lame_dec_handler = nullptr;
std::vector<unsigned char> mp3Buffer;
std::vector<short> decodedLeftChannel;
std::vector<short> decodedRightChannel;
RingBuffer<float> outputPCMBuffer;
std::vector<float> readBuf;
};