Commit 757426ba authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Implement setting to deactivate audio ducking

parent 330bba53
......@@ -365,6 +365,8 @@
<string name="aout_summary">Change the method that VLC uses to output audio.</string>
<string name="aout_audiotrack" translatable="false">AudioTrack</string>
<string name="aout_opensles" translatable="false">OpenSL ES</string>
<string name="audio_ducking_title">Lower VLC volume on notifications</string>
<string name="audio_ducking_summary">Helps to hear audio notifications, navigation instructions or assistant talking</string>
<string name="extensions_prefs_category">Extensions</string>
<string name="extensions_enable_category">Chose extensions to enable</string>
......
......@@ -45,6 +45,11 @@
</PreferenceCategory>
<PreferenceCategory android:title="@string/advanced_prefs_category">
<CheckBoxPreference
android:key="audio_ducking"
android:defaultValue="true"
android:summary="@string/audio_ducking_summary"
android:title="@string/audio_ducking_title" />
<ListPreference
android:defaultValue="0"
android:entries="@array/aouts"
......
......@@ -397,7 +397,7 @@ public class PlaybackService extends MediaBrowserServiceCompat implements IVLCVo
if (isPlaying()) {
if (AndroidDevices.isAmazon) {
pausePlayback();
} else {
} else if (mSettings.getBoolean("audio_ducking", true)) {
final int volume = AndroidDevices.isAndroidTv ? getVolume()
: mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
if (audioDuckLevel == -1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment