- Edited
Hello,
I'm trying to stream data that the Bela is recording from 4 mics to PC via OSC. However I'm a bit of a novice with communications/networks and having difficulty figuring out how to send buffer to PC.
At the moment, I'm saving data to a .wav file using writeRt command in render like so
gPipe.writeRt(context->analogIn, context->analogFrames * context->analogInChannels);
Bela_scheduleAuxiliaryTask(gFillBufferTask);
Then using a writeBuffer function I found in example:
void writeBuffer(void*) {
unsigned int numItems = gAnalogFrames * gAnalogInChannels;
float buf[numItems];
int ret;
while((ret = gPipe.readNonRt(buf, numItems) ) > 0)
{
sf_write_float(outfile, &buf[0], ret);
}
}
I'd like to instead perhaps rewrite the writeBuffer function as follows
void writeBuffer(void*) {
unsigned int numItems = gAnalogFrames * gAnalogInChannels;
float buf[numItems];
int ret;
while((ret = gPipe.readNonRt(buf, numItems) ) > 0)
{
oscSender.newMessages("\fmcw_print", &buf[0], ret);
}
}
Is this the correct way to think about this? Any thoughts and tips would be greatly appreciated