VOX
A little voxel engine
Loading...
Searching...
No Matches
AudioData.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <vector>
5
6#include <glm/glm.hpp>
7
8namespace Sound
9{
10
11 class Data
12 {
13
14 public:
15
16 Data(const std::string &file_name);
17 ~Data();
18
19
20 uint16_t audio_format = 0;
21 uint16_t num_channels = 0;
22 uint32_t sample_rate = 0;
23 uint32_t byte_rate = 0;
24 uint16_t block_align = 0;
25 uint16_t bits_per_sample = 0;
26
27 uint32_t num_samples = 0;
28
29 std::vector<std::vector<float>> samples;
30
31 private:
32
33 enum class WaveFormat : uint16_t
34 {
35 WAVE_FORMAT_PCM = 0x0001,
36 WAVE_FORMAT_IEEE_FLOAT = 0x0003,
37 WAVE_FORMAT_ALAW = 0x0006,
38 WAVE_FORMAT_MULAW = 0x0007,
39 WAVE_FORMAT_EXTENSIBLE = 0xFFFE
40 };
41
42 float bytesToFloat(std::vector<uint8_t> &bytes);
43 };
44
45} // namespace Sound
Definition: AudioData.hpp:12
uint16_t num_channels
Definition: AudioData.hpp:21
uint32_t byte_rate
Definition: AudioData.hpp:23
std::vector< std::vector< float > > samples
Definition: AudioData.hpp:29
uint16_t bits_per_sample
Definition: AudioData.hpp:25
uint32_t sample_rate
Definition: AudioData.hpp:22
uint16_t audio_format
Definition: AudioData.hpp:20
~Data()
Definition: AudioData.cpp:118
uint16_t block_align
Definition: AudioData.hpp:24
uint32_t num_samples
Definition: AudioData.hpp:27
Definition: AudioData.cpp:7