Openvidu subscriber volume on android - android

So using openvidu to setup two way calling but I noticed an issue when it’s being used on an android device.
The android phone has multiple volume controls, one of them is the media volume, so if the user watching as a subscriber has their media volume low they can’t hear the publisher speaking until they turn it up, and a few people don’t even know this exists.
By default the volume up hardware button seems to control the phone volume, or rather it seems to control the last one that was used.
It’s a little concerning that many people won’t know about this and will complain they can’t hear anything, unlike on the iPhone where the one button controls the overall volume.
I doubt this is possible but are we able to increase the android media volume
With JavaScript somehow? I very much doubt it but I’m not sure how to solve this problem if we can’t. I know we can control the video element volume itself but that seems to have no impact on the phone volume itself. As in I can turn the phone media volume all the way up but control the video element separate instead of them working together.

Related

How To disable system settings automatically while playing music in Android

This question is for anyone who knows about audio on Android devices.
We need an Android app for auditory training.
In this app, individualised music is downloaded for each user and then listened to for a while for trining purposes.
It is essential that this music is played unchanged, i.e. without the influence of equalisers, room sound, bass amplification, etc.
Is there a way to bypass the system audio settings in the app or to deactivate them automatically?
Different manufacturers seem to handle the system audio settings somewhat differently. We have noticed differences between Samsung, Google, Sony, Motorola, OnePlus, Redmi.
Therefore, it might make the most sense to bypass the system audio within the app.
We have made attempts with CONTENT-TYPE and USAGE_ because we had the hope that USAGE_VOICE-COMMUNICATION would bypass the equalisers. But that doesn't work and some manufacturers seem to activate compressors or noise reduction, which degrades the quality of the music.
So far we are working with the integrated player.
Does a self-programmed player make a difference?
Does anyone know a solution?
Thank you!

How to make background sound quiter

If you have an app like Spotify playing music in a background and try to listen to some sound in Google Chrome at the same moment, the background music becomes quieter at this very moment while Chrome playing the sound and then comes back to normal level.
I am wondering how I can do the same from my own Android app, namely, to make volume of all other applications lower for some time, but allow my application to play sounds with normal volume at the same time. I tried to find the answer, but usually all recommendations are about how to change volume globally.
This is a feature called audio ducking- the sound that gets quieter is said to be ducked. The way Android does it is through audio focus. Your app needs to request focus, and the other app's sound will be changed appropriately. The documentation on it is at https://developer.android.com/guide/topics/media-apps/audio-focus. The mechanism changed in Android 12, so you'll likely have to have different code for older versions and newer ones to make it all work.

How to handle audio focus when other apps do not respect focus loss policy

My navigation app have to play direction hints as ordinary navigation apps do. Before playing message I used audio focus policy as described here: https://android-developers.googleblog.com/2013/08/respecting-audio-focus.html
Unfortunately this does not work in all the cases, obviously problematic apps does not meet audio focus policy, still this explanation is not satisfying for my users so I wonder if there is a way to solve this problem ?
What I tried is switching audio streams while setting MUSIC stream to mute, however my app also handles volume changes internally, so during switch I need to get volume level from one stream set it to another then revert changes after playback and finally unmute previous stream. To sum up this looks awful and still has some drawbacks which can influence user experience.
Anyone solved this ?

Is Android capable of managing microphone/input volume?

I've searched everywhere, including the RootTools source. I can't find anything that manages the microphone, apart from muting it altogether. And there are no hints inside the AudioRecorder.setMicrophoneMute(bool) method either...
There are a few posts about this issue, but none of them ever go anywhere (through no fault of OPs'). Is it (legally) possible to override the OS and get to the mic hardware directly or something?
Thanks,
-tre
You can't directly set the recording volume, but you can change what you do with the byte data you get from AudioRecord (look at the AudioTrack class for reducing the volume of the track)
Edit: I forgot to mention that if you're having trouble with volume spikes you can look at automatic gain control. Some devices activate it automatically, but you can manually enable it.
On occasion, I get a phone or tablet with poorly chosen microphone input volume. Android 4 had it adjustable but not the newer versions. It makes it impossible to use VOIP. It's not just for fancy audio recordings.

Receiver for device media buttons NOT "media button"

My goal is to start a service with a media button event received from another application (i.e., when to user selects play/pause in a given media app). The catch is, I need to target the media buttons on their device and not on their headset.
To clarify I am aware of the ACTION_MEDIA_BUTTON and am almost certain it is of no value for my purpose. I may be wrong though. But I'm pretty sure.
I need an approach that targets the media buttons of the device itself.
I'm completely lost and sleep deprived. Any help would be appreciated. Thanks.
The catch is, I need to target the media buttons on their device and not on their headset.
There are no hardware media buttons on their device, for hundreds of millions of devices, beyond perhaps volume buttons. If you are dealing with some specific device that has other hardware media buttons, you will need to contact the device's manufacturer for details.
If, by "media buttons" and "when to user selects play/pause in a given media app", you are trying to spy on other applications, this is not possible, for obvious privacy reasons. Some media players have an API for announcing track changes and the like, which you might be able to use, but there is no standard API that I am aware of, and neither the AOSP Music app nor Google's proprietary Play Music app have any such documented and supported API.

Categories

Resources