Android: how to get the current active audio IDs

I need to get the current Active Audio Session identifiers in order to attach some sound effects to them. This session is not necessarily created by my process.

Is there any interface provided by audioTrack or something else to implement this functionality?

+4
source share
1 answer

You can simply use getAudioSessionId () from AudioTrack if you have access to its object.

In the event that this is not necessarily created by your process, the last resort is to use “0” as the session identifier that matches the combination of audio output, but your effect will apply to everything.

-1
source

Source: https://habr.com/ru/post/1484438/


All Articles