6

I need to get the current Active audio session IDs to attach some audio effects on them. This session is not necessarily created by my process.

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

jenny
  • 93
  • 1
  • 6
  • Just to clarify: do you mean the audio session id? – Michael Jun 04 '13 at 16:47
  • Hi, yes, I meant the audio session ID. Do you know how to get? – jenny Jun 04 '13 at 19:02
  • 1
    Any news on how to find the current active audio session id ? This is crucial for example if you want to make an equalizer that applies to the whole android phone. Before setting it to 0 was working, but this is now deprecated and does not work on my phone (Nexus 5 Android 6.0) – Gabriel Morin Jul 25 '16 at 08:56

1 Answers1

-1

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

In case it's not necessarily created by your process, your last resort is to use "0" as session ID which corresponds to the audio output mix, but your effect will apply to everything.

Aladin Q
  • 550
  • 5
  • 12
  • 1
    NOTE: attaching insert effects (equalizer, bass boost, virtualizer) to the global audio output mix by use of session 0 is deprecated. – Ziv Kesten Dec 20 '17 at 12:21