bryan costanich
bryan costanich

Reputation: 1739

Android: Getting Notified when Audio is Played

Is it possible to be notified in Android when the Audio system starts playing audio? it looks like i should wire up a BroadcastReceiver, but it's not clear what i would listen for. I could listen for the MediaPlayer intent, but that would only capture when that particular application was playing audio, not when a third party application played audio, etc.

Any ideas?

Upvotes: 1

Views: 224

Answers (2)

bryan costanich
bryan costanich

Reputation: 1739

Looks like it's only available on android OS 2.2+ (froyo) via the AudioManager.OnAudioFocusChangeListener.

Upvotes: 2

Aaron Saunders
Aaron Saunders

Reputation: 33345

Can you hook into this listener events, for pre 2.2

requestAudioFocus() and abandonAudioFocus()

Upvotes: 0

Related Questions