| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,21 @@ |
| 1 |
+#ifndef ADPCMDECODER_H |
|
| 2 |
+#define ADPCMDECODER_H |
|
| 3 |
+ |
|
| 4 |
+#include <vector> |
|
| 5 |
+#include <cstdint> |
|
| 6 |
+ |
|
| 7 |
+class AdpcmDecoder |
|
| 8 |
+{
|
|
| 9 |
+private: |
|
| 10 |
+ int16_t predictor; |
|
| 11 |
+ int8_t index; |
|
| 12 |
+ |
|
| 13 |
+public: |
|
| 14 |
+ AdpcmDecoder(int16_t initialPredictor, int16_t initialStep); |
|
| 15 |
+ int16_t getNextSample(uint8_t value); |
|
| 16 |
+ |
|
| 17 |
+ std::vector<int16_t> decode(const std::vector<char>& data, uint32_t offset = 0, uint32_t length = 0); |
|
| 18 |
+ static std::vector<int16_t> decodeFile(const std::vector<char>& data, uint32_t offset = 0, uint32_t length = 0); |
|
| 19 |
+}; |
|
| 20 |
+ |
|
| 21 |
+#endif |