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
11
votes
3 answers

What is the difference between AudioManager's stream types at low level?

There are several stream types in AudioManager. How did they differ at low level? Could it be that usage of e.g. AudioManager.STREAM_MUSIC blocks input microphone stream? Or something else?
Kirill Boyarshinov
  • 6,143
  • 4
  • 33
  • 29
10
votes
2 answers

AudioManager auto switching own mode + not respecting setSpeakerphoneOn()

I want to play some audio with volume lvl adjusted to ear aka. "phone call mode". For this purpose, I'm using well-known and commonly advised audioManager.setMode(audioNormalState ? AudioManager.MODE_NORMAL :…
snachmsm
  • 17,866
  • 3
  • 32
  • 74
10
votes
1 answer

What does the flag parameter mean and what is range of possible min and max of droid device

I want to know what is flag(or what are the possible values for flag) in audiomanager.setStreamVolume (int streamType, int index, int flags); I know we can get the maximum stream…
Zar E Ahmer
  • 33,936
  • 20
  • 234
  • 300
10
votes
3 answers

Android: Ringer mode changed to silent doesn't stop the phone vibrating

I'm trying to change the ringer mode of the phone to RINGER_MODE_SILENT when a call is incoming by using the following lines of code. AudioManager am = (AudioManager)…
Flo
  • 27,355
  • 15
  • 87
  • 125
10
votes
4 answers

Android - can I mute currently playing audio applications?

Hi I'm new to this. My self-teaching project is a small application which plays an audio news stream. To be effective, the application really needs to interrupt any currently playing media players (eg: Last FM, Imeem, music player, Spotify etc). …
user235900
10
votes
1 answer

Android: Forcing external microphone (jack input 3.5mm) to stay on

How do I force the Android system to select the 3.5mm Jack as my microphone source? I am using the AudioRecord class to do the recording. I am using an external Microphone. When it is detected all works well, but sometimes the external microphone…
user2819360
  • 113
  • 1
  • 1
  • 5
9
votes
4 answers

Changing data source for audio playback using existing MediaPlayer?

I'm trying to use the same media player but change the data source. Here is what I'm trying to do:  private MediaPlayer mMediaPlayer; public void pickFile1() { initMediaPlayer("myfile1.mp3"); } public void pickFile2() { …
Alan Moore
  • 6,525
  • 6
  • 55
  • 68
9
votes
0 answers

TextToSpeech audio routed to phone speaker instead of bluetooth headset

I have an app that uses android.speech.tts.TextToSpeech.speak() to readout messages. The messages are only supposed to be readout to a connected bluetooth headset. So before I call the speak method I check AudioManager.isBluetoothA2dpOn(); Speak…
9
votes
1 answer

Speaker Volume (Alarm) decreases when Headphones are plugged in

I'm trying to play an alarm sound through the speakers via the alarm channel at max volume. For that I'm using the AudioManager and a MediaPlayer. If I plug in headphones, the alarm is still played through the speakers, however the volume of the…
9
votes
2 answers

Android: Voice Recording and saving audio

I am working on application that will record the voice of the user and save the file on the SD card and then allow the user to listen to the audio again. I am able to allow the user to record his voice using the RecognizerIntent, but I cant figure…
8
votes
2 answers

What is the differences between MODE_IN_CALL, MODE_IN_COMMUNICATION, MODE_CALL_SCREENING?

This is what the file says, but I can't fully understand. /* modes for setMode/getMode/setRoute/getRoute */ /** * Audio harware modes. */ /** * Invalid audio mode. */ public static final int MODE_INVALID =…
c-an
  • 3,543
  • 5
  • 35
  • 82
8
votes
1 answer

AudioManager setStreamVolume without flags

The Android AudioManager has the method public void setStreamVolume (int streamType, int index, int flags). I don't want to use any flags as they all are used to enable feedback. I don't want vibration, or a UI pop-up, or a hint of any sort. I don't…
DarkMatterMatt
  • 576
  • 10
  • 22
8
votes
2 answers

AudioManager is introducing delay in the setMode(MODE_IN_COMMUNICATION)

I am trying to play sound on speaker even if headphones are on, BUT if there is music playing in background, I want the music to be played on headphones until the sound is played. So I am taking the next steps: Before I play sound, I gain…
8
votes
4 answers

Audiomanager Speaker not working

I'm trying to enable the speaker while I am in a call: final AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); audioManager.setSpeakerphoneOn(true); I tried to check after the setSpeakerphoneOn() the…
motis10
  • 2,484
  • 1
  • 22
  • 46
8
votes
3 answers

Retrieving the application name that has audio focus change

I can't seem to find anything related to finding out what application got audio focus. I can correctly determine from my application what type of focus change it was, but not from any other application. Is there any way to determine what application…
Trevor
  • 7,777
  • 6
  • 31
  • 50