libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
WaveTableLoader.h
Go to the documentation of this file.
1#pragma once
2#include "fatfs.h"
3#include "util/wav_format.h"
4namespace daisy
5{
14{
15 public:
16 enum class Result
17 {
18 OK,
22 };
25
27 void Init(float *mem, size_t mem_size);
28
31
41 Result Import(const char *filename);
42
44 float *GetTable(size_t idx);
45
46 private:
47 static constexpr int kWorkspaceSize = 1024;
48 float * buf_;
49 size_t buf_size_;
50 WAV_FormatTypeDef header_;
51 size_t samps_per_table_;
52 size_t num_tables_;
53 int32_t workspace[kWorkspaceSize];
54 FIL fp_;
55};
56
57} // namespace daisy
Definition leddriver.h:33
Definition WaveTableLoader.h:14
WaveTableLoader()
Definition WaveTableLoader.h:23
~WaveTableLoader()
Definition WaveTableLoader.h:24
Result SetWaveTableInfo(size_t samps, size_t count)
Result Import(const char *filename)
Result
Definition WaveTableLoader.h:17
float * GetTable(size_t idx)
void Init(float *mem, size_t mem_size)
Hardware defines and helpers for daisy field platform.
Definition index.h:2
Definition wav_format.h:39