libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
audio.h
Go to the documentation of this file.
1#ifndef DSY_AUDIO_H
2#define DSY_AUDIO_H
4#include "per/sai.h"
5
6namespace daisy
7{
23{
24 public:
44
45 enum class Result
46 {
47 OK,
48 ERR,
49 };
50
55 typedef const float* const* InputBuffer;
56
60 typedef float** OutputBuffer;
61
67 size_t size);
68
73 typedef const float* InterleavingInputBuffer;
74
79
85 size_t size);
86
87 AudioHandle() : pimpl_(nullptr) {}
89
90 AudioHandle(const AudioHandle& other) = default;
92
95
98
101
103 const Config& GetConfig() const;
104
112 size_t GetChannels() const;
113
116
119
124
130
138
141
146
149
152
155
156
157 class Impl;
158
159 private:
160 Impl* pimpl_;
161};
162
163} // namespace daisy
164
165#endif
Audio Engine Handle.
Definition audio.h:23
Result Start(AudioCallback callback)
void(* AudioCallback)(InputBuffer in, OutputBuffer out, size_t size)
Definition audio.h:65
void(* InterleavingAudioCallback)(InterleavingInputBuffer in, InterleavingOutputBuffer out, size_t size)
Definition audio.h:83
float * InterleavingOutputBuffer
Definition audio.h:78
const float * InterleavingInputBuffer
Definition audio.h:73
Result ChangeCallback(InterleavingAudioCallback callback)
Result SetSampleRate(SaiHandle::Config::SampleRate samplerate)
~AudioHandle()
Definition audio.h:88
const Config & GetConfig() const
Result SetBlockSize(size_t size)
AudioHandle(const AudioHandle &other)=default
Result Start(InterleavingAudioCallback callback)
size_t GetChannels() const
float ** OutputBuffer
Definition audio.h:60
AudioHandle()
Definition audio.h:87
const float *const * InputBuffer
Definition audio.h:55
Result Init(const Config &config, SaiHandle sai)
AudioHandle & operator=(const AudioHandle &other)=default
Result SetOutputCompensation(float val)
Result ChangeCallback(AudioCallback callback)
Result Init(const Config &config, SaiHandle sai1, SaiHandle sai2)
Result SetPostGain(float val)
Result
Definition audio.h:46
Definition leddriver.h:33
Definition sai.h:44
Hardware defines and helpers for daisy field platform.
Definition index.h:2
Definition audio.h:28
float output_compensation
Definition audio.h:42
SaiHandle::Config::SampleRate samplerate
Definition audio.h:34
size_t blocksize
Definition audio.h:30
float postgain
Definition audio.h:37
SampleRate
Definition sai.h:58