Increase version, do not use super frame size for OPUS

master
sh123 2023-12-25 12:51:56 +02:00
rodzic b19dcb8ca3
commit dda3677b00
5 zmienionych plików z 13 dodań i 16 usunięć

Wyświetl plik

@ -10,8 +10,8 @@ android {
applicationId "com.radio.codec2talkie"
minSdkVersion 23
targetSdkVersion 30
versionCode 168
versionName "1.68"
versionCode 169
versionName "1.69"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Wyświetl plik

@ -2,7 +2,6 @@ package com.radio.codec2talkie.protocol;
import android.content.Context;
import android.content.SharedPreferences;
import android.text.TextUtils;
import android.util.Log;
import androidx.preference.PreferenceManager;
@ -10,7 +9,6 @@ import androidx.preference.PreferenceManager;
import com.radio.codec2talkie.protocol.message.TextMessage;
import com.radio.codec2talkie.protocol.position.Position;
import com.radio.codec2talkie.settings.PreferenceKeys;
import com.radio.codec2talkie.tools.DebugTools;
import com.radio.codec2talkie.transport.Transport;
import com.radio.opus.Opus;
@ -48,18 +46,17 @@ public class AudioOpus implements Protocol {
int complexity = Integer.parseInt(sharedPreferences.getString(PreferenceKeys.OPUS_COMPLEXITY, "5"));
float pcmFrameDuration = Float.parseFloat(sharedPreferences.getString(PreferenceKeys.OPUS_FRAME_SIZE, "40"));
int superFrameSize = Integer.parseInt(sharedPreferences.getString(PreferenceKeys.CODEC2_TX_FRAME_MAX_SIZE, "48"));
_pcmFrameSize = (int)(SAMPLE_RATE / 1000 * pcmFrameDuration);
_audioBufferSize = 10*_pcmFrameSize;
_playbackAudioBuffer = new short[_audioBufferSize];
_recordAudioEncodedBuffer = new byte[superFrameSize];
_recordAudioEncodedBuffer = new byte[_audioBufferSize];
_opusCon = Opus.create(SAMPLE_RATE, 1, Opus.OPUS_APPLICATION_VOIP, bitRate, complexity);
if (_opusCon == 0) {
Log.e(TAG, "Failed to create opus");
}
Log.i(TAG, "Opus is initialized, pcm frame size: " + _pcmFrameSize + ", super frame size: " + superFrameSize);
Log.i(TAG, "Opus is initialized, pcm frame size: " + _pcmFrameSize + ", buffer size: " + _audioBufferSize);
}
@Override

Wyświetl plik

@ -180,7 +180,7 @@
<string name="kiss_toast_modem_reboot">Modem reboot requested</string>
<string name="codec2_tx_frame_max_size_title">Maximum super frame size (bytes)</string>
<string name="codec2_tx_frame_max_size_summary">Multiple audio codec encoded samples are aggregated into super frame not larger than this value</string>
<string name="codec2_tx_frame_max_size_summary">Multiple Codec2 encoded samples are aggregated into super frame not larger than this value</string>
<string name="usb_settings_title">USB settings</string>
<string name="usb_data_bits_title">Serial data bits</string>

Wyświetl plik

@ -133,14 +133,7 @@
app:summary="@string/codec_type_settings_summary"
app:fragment="com.radio.codec2talkie.settings.SettingsActivity$SettingsCodecFragment">
</Preference>
<EditTextPreference
app:key="codec2_tx_frame_max_size"
app:title="@string/codec2_tx_frame_max_size_title"
app:summary="@string/codec2_tx_frame_max_size_summary"
app:defaultValue="48">
</EditTextPreference>
<SwitchPreference
app:key="codec2_recording_enabled"
app:title="@string/codec2_recorder_title"

Wyświetl plik

@ -15,6 +15,13 @@
app:summary="%s">
</ListPreference>
<EditTextPreference
app:key="codec2_tx_frame_max_size"
app:title="@string/codec2_tx_frame_max_size_title"
app:summary="@string/codec2_tx_frame_max_size_summary"
app:defaultValue="48">
</EditTextPreference>
</PreferenceCategory>
<PreferenceCategory