How do I pass the InputBuffer and OutputBuffer from the AudioCallback into a class so it works properly?
This is what I’m trying, and there is no audio:
// main.cpp
void AudioCallback(AudioHandle::InputBuffer CallbackIn, AudioHandle::OutputBuffer CallbackOut, size_t Size){
AudioBlock Block;
Block.ReadFromDaisy(CallbackIn);
PassThroughEngine(Block);
CallbackOut = Block.WriteToDaisy(CallbackOut);
}
class AudioBlock{
// ...
// AudioBlock.cpp :
typedef const float* const* InputBuffer;
void ReadFromDaisy(InputBuffer CallbackIn ){
for(int i = 0; i < ChannelCount; i++){
for(int j = 0; j < BLOCK_SIZE; j++){
Samples[i][j] = CallbackIn[i][j];
}
}
}
typedef float** OutputBuffer;
OutputBuffer WriteToDaisy(OutputBuffer CallbackOut){
for(int i = 0; i < ChannelCount; i++){
for(int j = 0; j < BLOCK_SIZE; j++){
//CallbackOut[i][j] = Samples[i][j];
}
}
}
}