Jump to content
  • 1

Suggestion - Proper mute for Android Client


Nytohan

Question

I have been using the android client for the last couple days and have noticed my Bluetooth headset is dying unusually fast where it usually lasts ~10 hours of sporadic listening.

I suspect what's happening is that despite lowering the volume in the PokeMMO Android client to 0, the client is still producing and sending sound data of no volume, but forcing the headset to stay active.
Any chance we can get a true mute toggle in the android client?

Link to comment

4 answers to this question

Recommended Posts

  • 0
6 hours ago, Nytohan said:

I have been using the android client for the last couple days and have noticed my Bluetooth headset is dying unusually fast where it usually lasts ~10 hours of sporadic listening.

I suspect what's happening is that despite lowering the volume in the PokeMMO Android client to 0, the client is still producing and sending sound data of no volume, but forcing the headset to stay active.
Any chance we can get a true mute toggle in the android client?

Wouldn't that be doable in app settings? 

Link to comment
  • 0
59 minutes ago, Dibz said:

Wouldn't that be doable in app settings? 

There's no OS level ability to deny audio access to an application that I can find (On stock android Q beta on Pixel 3XL)

Inside the android pokemmo client there are volume sliders, but no actual mute. This distinction is important, as it may mean the difference between not sending audio and sending audio of zero volume.

Edited by Nytohan
Link to comment
  • 0
1 hour ago, Dibz said:

I just found a bunch of apps that can do that for you: 

 

https://gizmodo.com/set-different-volume-levels-for-each-app-on-your-androi-1756332280

 

https://play.google.com/store/apps/details?id=com.samsung.android.soundassistant

 

Looks like there's no way to locally do it through any app in and of itself unless you have an app like one of these two. 

It's entirely possible inside an app to implement a mute feature.

You just have a flag that prevents sound from being played by the app when it otherwise would.

The fact that the app makes sound at all is something that had to be built, so somewhere in the source they are initializing a media player. They just need the ability to fully stop the media player in the app as opposed to just decreasing its volume.

 

To oversimplify a little, assuming this is written in Java (Likely given that it's on android, though it could be kotlin)
Something like this would do:

onMuteClicked(boolean mutedState){
	if(mutedState == true){
		this.mutedState = true;
		this.mediaPlayer.stop();
	} else{
		this.mutedState = false;
		this.startSound();
	}
}

This is oversimplified, mind you. I don't actually know how the application is structured, but essentially you just need to detect when the state of the mute toggle is changed. If it is changed to true, stop the MediaPlayer objects you have running, and prevent them from starting while muted.


If changed to false, do whatever is normally done to initialize sound.

 

In whatever the startSound() function would be, you wrap the existing code in a block that only executes if this.mutedState is false.

 

Totally achievable.

Edited by Nytohan
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.