23 lines
479 B
C
Raw Normal View History

2019-10-26 01:51:40 +02:00
#pragma once
#include <cstdint>
#include <memory>
namespace tc::audio {
/* Every sample is a float (4byte) */
2021-03-25 15:21:47 +01:00
struct SampleBuffer {
static std::shared_ptr<SampleBuffer> allocate(uint8_t /* channels */, uint16_t /* samples */);
2019-10-26 01:51:40 +02:00
uint16_t sample_size;
uint16_t sample_index;
2019-10-26 01:51:40 +02:00
char sample_data[
2021-03-25 15:21:47 +01:00
/* windows does not allow zero sized arrays */
2019-10-26 01:51:40 +02:00
#ifndef WIN32
0
2019-10-26 01:51:40 +02:00
#else
2021-03-25 15:21:47 +01:00
1
2019-10-26 01:51:40 +02:00
#endif
];
};
2019-10-26 01:51:40 +02:00
}