kopia lustrzana https://github.com/sh123/codec2_talkie
rodzic
638d9a4425
commit
4231791caf
|
@ -80,7 +80,7 @@ public class AudioTools {
|
|||
|
||||
// use freedv mode text instead if it is active
|
||||
String freedvModeLabel = getFreedvModeAsText(sharedPreferences);
|
||||
if (freedvModeLabel != null) return "DV: " + freedvModeLabel;
|
||||
if (freedvModeLabel != null) return freedvModeLabel;
|
||||
|
||||
// codec2 speed
|
||||
String speedModeInfo = "C2: " + AudioTools.extractCodec2Speed(codec2ModeName);
|
||||
|
|
|
@ -162,13 +162,7 @@ public class SoundModemFsk implements Transport, Runnable {
|
|||
// read samples to record audio buffer if there is enough data
|
||||
if (_recordAudioSampleBuffer.position() >= nin) {
|
||||
_recordAudioSampleBuffer.flip();
|
||||
try {
|
||||
_recordAudioSampleBuffer.get(_recordAudioBuffer, 0, nin);
|
||||
} catch (BufferUnderflowException e) {
|
||||
e.printStackTrace();
|
||||
_recordAudioSampleBuffer.clear();
|
||||
return 0;
|
||||
}
|
||||
_recordAudioSampleBuffer.compact();
|
||||
//Log.i(TAG, "read " + _recordAudioBuffer.position() + " " +audioSamples.length + " " + DebugTools.shortsToHex(audioSamples));
|
||||
// otherwise return void to the user
|
||||
|
@ -240,6 +234,7 @@ public class SoundModemFsk implements Transport, Runnable {
|
|||
byte [] bitBufferTail = Arrays.copyOf(_playbackBitBuffer, j);
|
||||
Codec2.fskModulate(_fskModem, _playbackAudioBuffer, bitBufferTail);
|
||||
if (_isLoopback) {
|
||||
synchronized (_recordAudioSampleBuffer) {
|
||||
for (short sample : _playbackAudioBuffer) {
|
||||
try {
|
||||
_recordAudioSampleBuffer.put(sample);
|
||||
|
@ -248,6 +243,7 @@ public class SoundModemFsk implements Transport, Runnable {
|
|||
_recordAudioSampleBuffer.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
_systemAudioPlayer.write(_playbackAudioBuffer, 0, _playbackAudioBuffer.length);
|
||||
}
|
||||
|
@ -289,7 +285,7 @@ public class SoundModemFsk implements Transport, Runnable {
|
|||
Log.w(TAG, "" + readCnt + " != " + readSize);
|
||||
continue;
|
||||
}
|
||||
synchronized (_recordAudioBuffer) {
|
||||
synchronized (_recordAudioSampleBuffer) {
|
||||
for (short sample : sampleBuf) {
|
||||
try {
|
||||
_recordAudioSampleBuffer.put(sample);
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
<string name="main_status_loopback_test">Loopback</string>
|
||||
<string name="main_status_stop">STOPPED</string>
|
||||
<string name="main_status_tx">TRANSMITTING</string>
|
||||
<string name="main_status_rx">RECEIVING</string>
|
||||
<string name="main_status_voice_received">(RECEIVING)</string>
|
||||
<string name="main_status_rx">(RECEIVING)</string>
|
||||
<string name="main_status_voice_received">RECEIVING</string>
|
||||
<string name="main_status_rx_error">RECEIVING\nERROR</string>
|
||||
<string name="main_status_tx_error">TRANSMITTING\nERROR</string>
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue