Questions tagged [android-audiomanager]

AudioManager provides access to volume and ringer mode control.

AudioManager provides access to volume and ringer mode control.

AudioManager Class Reference

792 questions
8
votes
1 answer

How to increase the ringer & notification volume programmatically in android

I am trying to enable the ringer normal mode and increase the volume programmatically. AudioManager mobilemode = (AudioManager)mContext.getSystemService(Context.AUDIO_SERVICE); // int streamMaxVolume =…
8
votes
1 answer

how to mute the "beep" by MediaRecorder.start()?

I have tried all methods mentioned in the following links How to shut off the sound MediaRecorder plays when the state changes Need to shut off the sound MediaRecorder plays when the state changes but none of them work. Anyone knows how to achieve…
suitianshi
  • 3,300
  • 1
  • 17
  • 34
8
votes
1 answer

Android Receive Broadcast on Audio Focus change

I am trying to write an app that detects whenever any app on the device starts or stops playing music. My app is not a media player, it's more of a dashboard functionality, so I have no need of requesting audio focus, but I want to know when other…
QuotidianVoid
  • 609
  • 5
  • 12
8
votes
2 answers

Android-dev AudioRecord without blocking or threads

I wish to record the microphone audio stream so I can do realtime DSP on it. I want to do so without having to use threads and without having .read() block while it waits for new audio data. UPDATE/ANSWER: It's a bug in Android. 4.2.2 still has the…
Jesse Gordon
  • 1,455
  • 15
  • 16
8
votes
1 answer

Detect whether headset has microphone

I need to detect whether the plugged in wired headset has microphone or not. I can check if a headset is plugged in using isWiredHeadSetOn(), but for microphone does not seem to be such a method in AudioManager class. I have found some suggestions…
niculare
  • 3,629
  • 1
  • 25
  • 39
8
votes
2 answers

Android: Hide Volume change bar from device?

is there a way to hide the volume change bar/notification (however you might call it..btw. how do you call it?) ? i attached a screenshot above. this bar is shown everytime i change the volume (at least on my nexus test device). or is this a nexus…
longi
  • 11,104
  • 10
  • 55
  • 89
8
votes
2 answers

Use AudioTrack with AudioManager setSpeakerphoneOn

I am using AudioTrack to play the sound I recieve through UDP sockets. I am getting a lot of noise along with the sound so I decided to use AudioManager. But AudioManager changes sound routing beyond the bounds of the application. Below is the code…
SoH
  • 2,180
  • 2
  • 24
  • 53
8
votes
1 answer

Constantly check for volume change in Android services

I wrote this piece of code, it's obviously flawed. How do I go about creating a service which will constantly check for changes in volume? Key listeners cannot be used in services, please don't post an answer with volume key listeners. My code is…
7
votes
1 answer

Headphone Jack Listener Android

Does anyone know how I can detect if the headphone jack on a device is unplugged on Android? I have a music player and I need to pause the music when the headphones are unplugged. The closest thing I have found is using the AudioManager. Is that the…
DRiFTy
  • 11,269
  • 11
  • 61
  • 77
7
votes
0 answers

Android - Audio Manager setSpeakerphoneOn - doesn't work on Huawei

Hy everybody, I have a problem with Audio Manager on Huawei phones. I have an app, which can route the voice of calls to earpiece or loudspeaker from bluetooth headset during the call. It works fine on all of the phones except Huawei phones. I…
opix
  • 71
  • 4
7
votes
5 answers

Playing two sounds Simutaneosly

I am trying to play two sounds simutaneosly in android.I have created two MediaPlayers and am using the code below.They are currently playing one after another.Or not exactly one after another but kinda delayed into eachother. private void…
james
  • 161
  • 1
  • 3
  • 8
7
votes
2 answers

How to Sync Sounds using SoundPool

I have been trying to get a few sounds to play at the same time; currently i'm using a shared instance of SoundPool. I would like 1, 2 or 3 sounds to be played at the exact same time with no lag. When calling SoundPool.play(...) X number of times…
7
votes
1 answer

Android: What Audio Mode should be set to send receive voice between devices

I am trying to stream voice/audio (two way) between two Android devices Tablet and Mobile (over java sockets). The Tablet can play received audio(voice) clearly, but the Mobile plays received audio as noise. Then i set this audio mode in the code…
7
votes
1 answer

Controlling the volume of forced-to-speaker audio

I'm playing an audio clip using OpenSL ES. In my code I have audioManager.setMode(AudioManager.MODE_IN_CALL); audioManager.setSpeakerphoneOn(true); to force audio through the speaker while the headset is plugged in. It works fine, but I…
Nitrooo
  • 73
  • 1
  • 4
7
votes
2 answers

How can I send a pre-recorded(wav) file during a voice call?

I want to develop an application through which if the caller calls you, the call should be answered automatically without user's involvement and the caller could hear a pre-recorded voice which is already recorded and saved.The audio file should be…