kopia lustrzana https://github.com/sh123/codec2_talkie
Update settings screenshot
rodzic
d745b4b963
commit
23d4beb14a
|
@ -1,6 +1,8 @@
|
|||
package com.radio.codec2talkie.protocol;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.BufferOverflowException;
|
||||
import java.nio.BufferUnderflowException;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
@ -9,7 +11,7 @@ public class KissParrot extends Kiss {
|
|||
|
||||
private final int BUFFER_SIZE = 3200 * 60 * 5;
|
||||
|
||||
private final int PLAYBACK_DELAY_MS = 2000;
|
||||
private final int PLAYBACK_DELAY_MS = 1000;
|
||||
|
||||
private final ByteBuffer _buffer;
|
||||
|
||||
|
@ -24,8 +26,10 @@ public class KissParrot extends Kiss {
|
|||
if (_buffer.position() > 0) {
|
||||
_buffer.flip();
|
||||
try {
|
||||
_transport.write(_buffer.array());
|
||||
} catch (IOException e) {
|
||||
byte[] b = new byte[_buffer.remaining()];
|
||||
_buffer.get(b);
|
||||
_transport.write(b);
|
||||
} catch (IOException | BufferUnderflowException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
_buffer.clear();
|
||||
|
@ -41,9 +45,12 @@ public class KissParrot extends Kiss {
|
|||
}
|
||||
} catch (IllegalStateException ignored) {}
|
||||
|
||||
_buffer.put(data);
|
||||
super.receiveKissData(data, callback);
|
||||
|
||||
try {
|
||||
_buffer.put(data);
|
||||
super.receiveKissData(data, callback);
|
||||
} catch (BufferOverflowException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
_playbackTimer = new Timer();
|
||||
_playbackTimer.schedule(new TimerTask() {
|
||||
@Override
|
||||
|
|
Plik binarny nie jest wyświetlany.
Przed Szerokość: | Wysokość: | Rozmiar: 34 KiB Po Szerokość: | Wysokość: | Rozmiar: 51 KiB |
Ładowanie…
Reference in New Issue