record voice in a Queue<byte[]> and send it to the server
问题 I am developing voice application. I need a buffer queue of some sort so that i record continuosly in a thread , place the buffers full of bytes into the queue and to transmit to the server, and i take the next buffer from the queue. Here is the recording code: Queue<byte[]> qArray = new LinkedList<byte[]>(); recordingThread = new Thread(new Runnable() { @Override public void run() { bData = new byte[BufferElements]; while (isRecording) { recorder.read(bData, 0, BufferElements); qArray.add