wavReader.h (595B)
1 #pragma once 2 3 #include <cstdint> 4 #include <string> 5 #include <vector> 6 7 namespace synthLib 8 { 9 struct CuePoint 10 { 11 size_t sampleOffset; 12 std::string name; 13 14 bool operator < (const CuePoint& _other) const 15 { 16 return sampleOffset < _other.sampleOffset; 17 } 18 }; 19 20 struct Data 21 { 22 const void* data = nullptr; 23 size_t dataByteSize = 0; 24 uint32_t bitsPerSample = 0; 25 uint32_t channels = 0; 26 uint32_t samplerate = 0; 27 bool isFloat = false; 28 }; 29 30 class WavReader 31 { 32 public: 33 static bool load(Data& _data, std::vector<CuePoint>* _cuePoints, const uint8_t* _buffer, size_t _bufferSize); 34 }; 35 };