11-10-2011 04:31 AM
I am trying to generate some 'music' from numerical data received via the TCP port. Data are being read at 100Hz by the TCP read function and placed on a queue in a producer loop, the queue is then being read in a consumer loop and the data are sent continuously to the sound output write function.
But that sound output write is causing a delay in the loop. Is there any way I can have that function running continuously in parallel with the TCP read and changing it's frequency value 'every now and then'?
11-10-2011 10:34 AM
Yeah I had the same problem, I was reading in an analogue input and then trying to output the same signal. The problem is is that it uses a buffer to store the information before it writes. The sequence goes.... Write the buffer to the output, and on the next loop fills the buffer back up.
You could try reducing the number of samples and therefore reductions the buffer size, but if your outputting music it will just become distorted.
I was reading in a electric guitar signal, and it came out distorted.
The closest I came to getting it to work was increasing the buffer size.. So it "recorded" a larger buffer.. But it was seriously delayed.
hope this helps a little bit.