15 #define NCHANNELS_INPUT_ANALOG 4
16 #define NCHANNELS_INPUT_AUDIO 2
18 bool setup(BelaContext *context,
void *ConnDetect_ptr)
25 }
catch(std::runtime_error& e) {
26 cerr <<
"Error initializing connection detection: " << e.what() << endl;
27 cerr <<
"Aborting..." << endl;
32 cerr <<
"Unexpected number of analog in channels. Given: "
33 << context->analogInChannels <<
". But required: "
38 Bela_setUserData(
static_cast<void*
>(pud));
51 void render(BelaContext *context,
void *ConnDetect_opaque)
67 for(
us n=0; n <context->analogFrames; n++) {
70 const float* acc_samples = &(mic_samples[2]);
71 ud.addSamples(context, mic_samples, acc_samples);
78 void cleanup(BelaContext *context,
void *ConnDetect_ptr)