Top
Audio Ducking
  • 22 Aug 2024
  • 1 Minute To Read
  • Dark
    Light
  • PDF

Audio Ducking

  • Dark
    Light
  • PDF

Article summary

Audio ducking is a process in which the level of one audio signal is reduced by the presence of another signal.

Whatfix Mobile supports audio ducking. If you have ExoPlayer, and you want Whatfix Mobile to duck audio on that window, then use the following code snippet. 

Your title goes here
If you've already handled audio focus in Exoplayer, ignore this.
Create an instance of com.google.android.exoplayer2.audio.AudioAttributes that matches your use case. You need to pass handleAudioFocus as true while setting the audioAttributes. For more information on audio focus with Exoplayer, see Easy Audio Focus with Exoplayer or use the following example:
AudioAttributes audioAttributes = new AudioAttributes.Builder()
 .setUsage(C.USAGE_MEDIA)
 .setContentType(C.CONTENT_TYPE_MOVIE)
 .build();
 
 exoPlayerInstance.setAudioAttributes(audioAttributes, 
 /* handleAudioFocus= */ true);



Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.