Audio Ducking
- 22 Aug 2024
- 1 Minute To Read
-
Print
-
DarkLight
-
PDF
Audio Ducking
- Updated On 22 Aug 2024
- 1 Minute To Read
-
Print
-
DarkLight
-
PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
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?