Get Sound volume size of android : Unity3d - android

I have developed game in unity3d.
In that game, i have given option for setting sound volume sound which affects my game sound object only, This does not relate with the android sound setting.
But i just want to check whether my android device is set to mute or not. If my device setting is mute then i will keep my game sound volume size value to 0.
But i am not getting the way to find the android device sound status,..if anyone is having idea then please guide me.
Thanks in advance for your support and help..

You can get the level of sound from your device this way:
AudioManager manager = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
int levelSound = manager.getStreamVolume(AudioManager.STREAM_MUSIC);
You need to know the stream you are using, normally Music for any multimedia sound (music, games, films, etc...)
You can check also this, to know the mode of the phone right now:
manager.getRingerMode();

Related

How to adjust microphone volume in Android programmatically

Is there a way to increase/decrease the input volume of the Android microphone. I did some research on Google as well as StackOverflow but didn't find a suitable answer.
Here are some links:
How to adjust microphone volume in android?
Adjust Microphone Recording Volume
Is Android capable of managing microphone/input volume?.
Please provide any help/reference.
I had a certain problem where I had to increase the volume (gain) of the sound and also filter out some frequencies I used TarsosDSP library for android it has a particular class called GainProcessor where you can adjust the sound accordingly. Hope it helps.

How can I record a video with sound of my app using Android Studio?

I am developing an app with Android Studio 2.1 and I would like to record a video of an usage example, with sound.
I have already recorded some videos, but always without sound. As the sound in my app is a key feature, I would like to have the video with the audio output of my app.
Is it possible? In case it is, how could I use it?
Thanks!
Maybe you should try using external app for recording both screen and sound. I have dig in just few mins and i have found some apps.
Here I left link to a top http://www.androidauthority.com/best-screen-recording-apps-600838/
The last one seems to be the one you are looking for (SCR Screen Recorder, which requires root), hope it works!
Other option could be to use a male to male audio cable and record the audio transmitted to the pc.

Lower system volume

I want to lower the ringtone, media volume, and alarm volume from an app (button press, no slider). So I've been reading up on AudioManager , but I'm still a bit confused on how to do this.
Also, with Audio Manager, is the volume set for the whole phone or just for the app? I want it to be for the whole phone
but I'm still a bit confused on how to do this
Call adjustStreamVolume() with your desired stream (e.g., STREAM_ALARM) and change (e.g., -1). Here is a sample project that demonstrates this.
is the volume set for the whole phone or just for the app?
Android does not have a concept of app-specific volume, so this is for the whole phone.

Is Android's Visualizer class's handling of media volume inconsistent across different devices?

I have made a music visualizer app for Android. While developing on my HTC Legend (running Android 2.2), I noticed that setting the "media volume" of the phone had no effect on the output of the Visalizer class, i.e. I always got the full-volume amplitude data of the playing music, regardless of the volume setting, which was great because that's precisely what I want.
I have recently purchased an Asus EEE transformer tablet, running Android 3.2, and now the user-set volume DOES impact the volume of the data I get back from the Visualiser class.
Does anyone know what the official behaviour should be? I'd hope for volume independence, but the evidence I've seen points to inconsistent behaviour across different devices...
Is this a driver issue, or has the behaviour changed in 3.2?
Thanks!
Nils
Refere this link here. I think that you are not enable equalizer and visualizer for same seesion id.Accroding to me Audio effects need equalizer engine enable for audio modifications settings.Otherwise it gives higher values and it will be affected by media volume also.

Android Find Phone App

I am playing around and I am trying to make a Android find phone app like the onces in the market place. if someone text my phone "beep" I want the phone to make a loud sound and if the phone is on silent i still want the sounds. I was thinking to use a alarm but the alarm does not make sound. can someone give me some
you are right... try out to invoke media player. because Media player always work immaterial to phone ringer. Something like this http://www.anddev.org/video-tut_-_playing_mediamp3_on_the_emulator-t156.html

Categories

Resources