Increase TCP send buffer size to the minimum audio buffer size
The original buffer sized used was 1/2 what was intended.
This commit is contained in:
@@ -65,6 +65,7 @@ public class MonitorActivity extends Activity
|
|||||||
frequency, channelConfiguration,
|
frequency, channelConfiguration,
|
||||||
audioEncoding, bufferSize);
|
audioEncoding, bufferSize);
|
||||||
|
|
||||||
|
final int byteBufferSize = bufferSize*2;
|
||||||
byte[] buffer = new byte[bufferSize*2];
|
byte[] buffer = new byte[bufferSize*2];
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -73,7 +74,7 @@ public class MonitorActivity extends Activity
|
|||||||
|
|
||||||
OutputStream out = socket.getOutputStream();
|
OutputStream out = socket.getOutputStream();
|
||||||
|
|
||||||
socket.setSendBufferSize(bufferSize);
|
socket.setSendBufferSize(byteBufferSize);
|
||||||
Log.d(TAG, "Socket send buffer size: " + socket.getSendBufferSize());
|
Log.d(TAG, "Socket send buffer size: " + socket.getSendBufferSize());
|
||||||
|
|
||||||
while (socket.isConnected() && Thread.currentThread().isInterrupted() == false)
|
while (socket.isConnected() && Thread.currentThread().isInterrupted() == false)
|
||||||
|
|||||||
Reference in New Issue
Block a user