1

I'm looking to detect how the audio is currently being outputted in my android phone.

I've been testing with:

android.bluetooth.headset.profile.action.AUDIO_STATE_CHANGED

Which offers information when the current audio device is a bluetooth head phone and when it is not, which is part of the solution.

However, I cannot seem to capture when the audio is being routed to the speakers versus the receiver versus wired headphones.

Ideally, there would be one broadcast which I am listening to, that fires whenever the audio route changes, such as when toggling between them during a call.

buczek
  • 2,011
  • 7
  • 29
  • 40

1 Answers1

0

There is AUDIO_BECOMING_NOISY intent which fires when the sound is being switched from headphones to speakers (see http://developer.android.com/guide/topics/media/mediaplayer.html#noisyintent).

And there is also a way for detecting the opposite switch, see How to detect when a user plugs headset on android device? (Opposite of ACTION_AUDIO_BECOMING_NOISY)

Community
  • 1
  • 1
Mikhail Naganov
  • 6,643
  • 1
  • 26
  • 26