Skip to content

Commit

Permalink
Added option to toggle music mode from app settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Decoder07 committed Aug 22, 2024
1 parent 0e1b04c commit 5ac4de3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 0 additions & 2 deletions packages/hms_room_kit/lib/src/service/app_debug_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ class AppDebugConfig {
Setting these values to defaults and can be toggled from the application
This will not be shipped with the ui_kit package and only used for internal testing
*/
static bool skipPreview = false;
static bool mirrorCamera = true;
static bool showStats = false;
static bool isSoftwareDecoderDisabled = true;
Expand All @@ -25,7 +24,6 @@ class AppDebugConfig {

/// Resets the debug configuration to default values
static void resetToDefault() {
skipPreview = false;
mirrorCamera = true;
showStats = false;
isSoftwareDecoderDisabled = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ class _AppSettingsBottomSheetState extends State<AppSettingsBottomSheet> {
AppDebugConfig.isSoftwareDecoderDisabled = isSoftwareDecoderDisabled;
AppDebugConfig.mirrorCamera = mirrorCamera;
AppDebugConfig.showStats = showStats;
AppDebugConfig.skipPreview = skipPreview;
AppDebugConfig.isDebugMode = isDebugMode;
AppDebugConfig.nameChangeOnPreview = true;
AppDebugConfig.isVirtualBackgroundEnabled = isVirtualBackgroundEnabled;
Expand Down
8 changes: 7 additions & 1 deletion packages/hmssdk_flutter/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ class _HomePageState extends State<HomePage> {
TextEditingController meetingLinkController = TextEditingController();
Uuid? uuid;
String uuidString = "";
HMSAudioMode audioMode = HMSAudioMode.VOICE;

PackageInfo _packageInfo = PackageInfo(
appName: 'Unknown',
Expand Down Expand Up @@ -264,6 +265,9 @@ class _HomePageState extends State<HomePage> {
} else {
meetingLinkController.text = widget.deepLinkURL ?? "";
}

int audioModeInt = await Utilities.getIntData(key: "audio-mode");
audioMode = HMSAudioMode.values[audioModeInt];
}

Future<bool> _closeApp() {
Expand Down Expand Up @@ -348,7 +352,9 @@ class _HomePageState extends State<HomePage> {
appGroup: "group.flutterhms",
preferredExtension:
"live.100ms.flutter.FlutterBroadcastUploadExtension"),
enableNoiseCancellation: true)),
enableNoiseCancellation: true,
isNoiseSuppressionEnabled: audioMode == HMSAudioMode.MUSIC,
isAutomaticGainControlEnabled: audioMode == HMSAudioMode.MUSIC)),
)));
}

Expand Down

0 comments on commit 5ac4de3

Please sign in to comment.