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.
source share