[FREE] AudioFocus

AudioFocus extensions

Audio focus control in Android applications.
Allows:
Request audio priority
Control the behavior of other applications (pause/mute)
Handle loss of focus
Blocks:


*nuances:

  • The degree of sound muting is determined automatically by the system.
  • It may take some time to switch focus. The event in focus may not be triggered at the right time. therefore, it is recommended to start your sound and then start the focus control function.
  • You cannot change the focus type until the previous focus is canceled. therefore, you can assign the type of focus as many times as you want, it won’t matter as long as the focus is provided and not canceled. to change the focus type, you should cancel the previous one.

Example:
You want to use TTS (Text-to-Speech) while temporarily ducking the background music player. After speech completes, the audio focus returns to the player.

AudioFocus.aix (7.7 KB)

2 Likes