From e502bc23b7d671bce5fe6da3e452e6fbb8aaf9eb Mon Sep 17 00:00:00 2001 From: Janez T Date: Sat, 14 Mar 2026 21:35:57 +0100 Subject: [PATCH] Update changelog to drop LPCNet --- CHANGELOG.md | 2 +- lib/services/voice_codec_preferences.dart | 21 -------------------- lib/utils/voice_message_parser.dart | 24 +++++++---------------- 3 files changed, 8 insertions(+), 39 deletions(-) delete mode 100644 lib/services/voice_codec_preferences.dart diff --git a/CHANGELOG.md b/CHANGELOG.md index b658661..76b44d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ - Discovery and contacts: finished the discovery flow, removed artificial UI delays, added profile storage and sync, and allowed contact name overrides. - Messaging and channels: fixed channel sync, deduplication, overwrite and deletion issues, cleared message input after send, and added delayed-message warning tracking. -- Voice and transport: added LPCNet voice mode support, fixed a voice quality regression, improved scan and advert parsing, and kept route path data visible in logs. +- Voice and transport: improved voice playback quality, improved scan and advert parsing, and kept route path data visible in logs. - Maps and field operations: enabled iOS background GPS updates, added GPX trail import/export, introduced a fullscreen repeater map, and added live mesh traffic views. - Localization and UI polish: added multilingual localization coverage, updated locale strings, fixed onboarding layout issues, and refined channel and contacts presentation. diff --git a/lib/services/voice_codec_preferences.dart b/lib/services/voice_codec_preferences.dart deleted file mode 100644 index 90adee0..0000000 --- a/lib/services/voice_codec_preferences.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:shared_preferences/shared_preferences.dart'; -import '../utils/voice_message_parser.dart'; - -class VoiceCodecPreferences { - static const String _codecKey = 'voice_codec'; - static const VoiceCodecKind defaultCodec = VoiceCodecKind.codec2; - - static Future getCodec() async { - final prefs = await SharedPreferences.getInstance(); - final raw = prefs.getString(_codecKey); - return VoiceCodecKind.values.firstWhere( - (codec) => codec.name == raw, - orElse: () => defaultCodec, - ); - } - - static Future setCodec(VoiceCodecKind codec) async { - final prefs = await SharedPreferences.getInstance(); - await prefs.setString(_codecKey, codec.name); - } -} diff --git a/lib/utils/voice_message_parser.dart b/lib/utils/voice_message_parser.dart index f70321e..b98ddd0 100644 --- a/lib/utils/voice_message_parser.dart +++ b/lib/utils/voice_message_parser.dart @@ -11,36 +11,26 @@ const int _defaultLoRaCrcEnabled = 1; const int _defaultLoRaExplicitHeader = 1; const double _defaultAirtimeBudgetFactor = 1.0; // one half duty-cycle -enum VoiceCodecKind { - codec2(0, 'Codec2'); - - const VoiceCodecKind(this.id, this.label); - final int id; - final String label; -} - /// Identifies which voice codec/mode was used for a packet. /// Matches the modeId byte in the text/binary packet header. enum VoicePacketMode { - mode700c(0, '700C', VoiceCodecKind.codec2, 8000, 100, 1600), - mode1200(1, '1200', VoiceCodecKind.codec2, 8000, 150, 1040), - mode2400(2, '2400', VoiceCodecKind.codec2, 8000, 300, 520), - mode1300(3, '1300', VoiceCodecKind.codec2, 8000, 175, 880), - mode1400(4, '1400', VoiceCodecKind.codec2, 8000, 175, 880), - mode1600(5, '1600', VoiceCodecKind.codec2, 8000, 200, 800), - mode3200(6, '3200', VoiceCodecKind.codec2, 8000, 400, 400); + mode700c(0, '700C', 8000, 100, 1600), + mode1200(1, '1200', 8000, 150, 1040), + mode2400(2, '2400', 8000, 300, 520), + mode1300(3, '1300', 8000, 175, 880), + mode1400(4, '1400', 8000, 175, 880), + mode1600(5, '1600', 8000, 200, 800), + mode3200(6, '3200', 8000, 400, 400); const VoicePacketMode( this.id, this.label, - this.codec, this.sampleRateHz, this.bytesPerSecond, this.packetDurationMs, ); final int id; final String label; - final VoiceCodecKind codec; final int sampleRateHz; final int bytesPerSecond; final int packetDurationMs;