|
129 | 129 | import static com.zoffcc.applications.nativeaudio.NativeAudio.na_set_audio_play_volume_percent; |
130 | 130 | import static com.zoffcc.applications.nativeaudio.NativeAudio.set_aec_active; |
131 | 131 | import static com.zoffcc.applications.nativeaudio.NativeAudio.set_audio_aec_delay; |
| 132 | +import static com.zoffcc.applications.nativeaudio.NativeAudio.set_gainprocessing_active; |
| 133 | +import static com.zoffcc.applications.nativeaudio.NativeAudio.set_rnnoise_active; |
132 | 134 | import static com.zoffcc.applications.trifa.AudioReceiver.channels_; |
133 | 135 | import static com.zoffcc.applications.trifa.AudioReceiver.sampling_rate_; |
134 | 136 | import static com.zoffcc.applications.trifa.AudioRecording.audio_engine_starting; |
@@ -526,6 +528,8 @@ public class MainActivity extends AppCompatActivity |
526 | 528 | static int PREF__ngc_audio_bitrate = NGC_AUDIO_BITRATE; |
527 | 529 | static int PREF__ngc_audio_samplerate = 48000; |
528 | 530 | static int PREF__ngc_audio_channels = 1; |
| 531 | + static boolean PREF__gainprocessing_active = true; |
| 532 | + static boolean PREF__rnnoise_active = false; |
529 | 533 |
|
530 | 534 | static String versionName = ""; |
531 | 535 | static int versionCode = -1; |
@@ -1280,6 +1284,26 @@ public void onNotYetInstalled() |
1280 | 1284 | PREF__use_push_service = true; |
1281 | 1285 | } |
1282 | 1286 |
|
| 1287 | + try |
| 1288 | + { |
| 1289 | + PREF__gainprocessing_active = settings.getBoolean("gainprocessing_active", true); |
| 1290 | + } |
| 1291 | + catch (Exception e) |
| 1292 | + { |
| 1293 | + e.printStackTrace(); |
| 1294 | + PREF__gainprocessing_active = true; |
| 1295 | + } |
| 1296 | + |
| 1297 | + try |
| 1298 | + { |
| 1299 | + PREF__rnnoise_active = settings.getBoolean("rnnoise_active", false); |
| 1300 | + } |
| 1301 | + catch (Exception e) |
| 1302 | + { |
| 1303 | + e.printStackTrace(); |
| 1304 | + PREF__rnnoise_active = false; |
| 1305 | + } |
| 1306 | + |
1283 | 1307 | //if (MainActivity.IS_GPLAY_VERSION) |
1284 | 1308 | //{ |
1285 | 1309 | try |
@@ -2820,6 +2844,42 @@ else if (PREF__higher_audio_quality == 1) |
2820 | 2844 | PREF__use_push_service = true; |
2821 | 2845 | } |
2822 | 2846 |
|
| 2847 | + try |
| 2848 | + { |
| 2849 | + PREF__gainprocessing_active = settings.getBoolean("gainprocessing_active", true); |
| 2850 | + } |
| 2851 | + catch (Exception e) |
| 2852 | + { |
| 2853 | + e.printStackTrace(); |
| 2854 | + PREF__gainprocessing_active = true; |
| 2855 | + } |
| 2856 | + if (PREF__gainprocessing_active) |
| 2857 | + { |
| 2858 | + set_gainprocessing_active(1); |
| 2859 | + } |
| 2860 | + else |
| 2861 | + { |
| 2862 | + set_gainprocessing_active(0); |
| 2863 | + } |
| 2864 | + |
| 2865 | + try |
| 2866 | + { |
| 2867 | + PREF__rnnoise_active = settings.getBoolean("rnnoise_active", false); |
| 2868 | + } |
| 2869 | + catch (Exception e) |
| 2870 | + { |
| 2871 | + e.printStackTrace(); |
| 2872 | + PREF__rnnoise_active = false; |
| 2873 | + } |
| 2874 | + if (PREF__rnnoise_active) |
| 2875 | + { |
| 2876 | + set_rnnoise_active(1); |
| 2877 | + } |
| 2878 | + else |
| 2879 | + { |
| 2880 | + set_rnnoise_active(0); |
| 2881 | + } |
| 2882 | + |
2823 | 2883 | //if (MainActivity.IS_GPLAY_VERSION) |
2824 | 2884 | //{ |
2825 | 2885 | try |
|
0 commit comments