- Edited
Hello, i am new to bela. I have a problem sending data through UDP. I read 8 channel microphone datas and send it through UDP port. I tried many approaches to send the 8 channel signal without channels being mixed up. My last solution is to create 8 different UdpClients.
audio_client0 = new UdpClient(remotePort0,remoteIP); // UDP client is initialized
audio_client1 = new UdpClient(remotePort1,remoteIP); // UDP client is initialized
audio_client2 = new UdpClient(remotePort2,remoteIP); // UDP client is initialized
audio_client3 = new UdpClient(remotePort3,remoteIP); // UDP client is initialized
audio_client4 = new UdpClient(remotePort4,remoteIP); // UDP client is initialized
audio_client5 = new UdpClient(remotePort5,remoteIP); // UDP client is initialized
audio_client6 = new UdpClient(remotePort6,remoteIP); // UDP client is initialized
audio_client7 = new UdpClient(remotePort7,remoteIP); // UDP client is initialized
Send 8 channel with 8 different UDP clients on 8 different ports as:
audio_client0->send(&gInputs[0], 16384);
audio_client1->send(&gInputs[1], 16384);
audio_client2->send(&gInputs[2], 16384);
audio_client3->send(&gInputs[3], 16384);
audio_client4->send(&gInputs[4], 16384);
audio_client5->send(&gInputs[5], 16384);
audio_client6->send(&gInputs[6], 16384);
audio_client7->send(&gInputs[7], 16384);`
But i am receiving almost the copies of 0'th channel. In all channels. Can you help me about what could have been causing this problem ?
Thank You
PS: microphone read code:
void render(BelaContext *context, void *userData)
{
// second_time = time(NULL);
// printf("%i", second_time - first_time, "\n");
// loops to store audio inputs
for(unsigned int n = 0; n < context->audioFrames; ++n) // loop to read all frames, processing frame by frame to ensure syncronisation
{
// getting audio samples from all channels
for(unsigned int c = 0; c < context->audioInChannels; ++c) // loop to read all channels
{
gInputs[c][n] = audioRead(context, n, c); // read audio of n th frame, c th channel
}
}