Listener on the audio output device changes

19 views
Skip to first unread message

frederi...@gmail.com

unread,
Mar 10, 2017, 6:53:15 PM3/10/17
to android-platform
Hi,
I have created a custom audio effect. It uses the standard AudioEffect API and is loaded on the main output mixer (session Id 0).
I need to change theaudio effect parameters according to the current audio output device ( speaker, earpiece, headphone or bt ).

I have the needed information via the audio effect command EFFECT_CMD_SET_DEVICE in the audio effect library (located in /system/lib/soundfx)
But for example, when output is Earpiece, I want to disable the library ( and so unload it). 
So I need the same information but on the Java layer (or outside the audio effect library)

How can I have a listener on the audio output device changes and the current device ID ?
At the moment I can only get information about the headphone or BT connection/disconnection.


Thx
Regards

Frederic
Reply all
Reply to author
Forward
0 new messages