TeamNewPipe / NewPipe

A libre lightweight streaming front-end for Android.
https://newpipe.net
GNU General Public License v3.0
31.38k stars 3.05k forks source link

Add option to separate the app's volume control from Android main volume #10556

Open benzen3 opened 11 months ago

benzen3 commented 11 months ago

Checklist

Feature description

Also described in this Stack Exchange post.

An option in the Settings so that the volume of Newpipe's output is decoupled from the Android main volume.

MXPlayer has something very similar in Settings > Audio > Disable the system volume. But this needs the file to be locally downloaded, seems to work with video files only,

Why do you want this feature?

My usecase is listening to some beats from YT, while watching lecture videos on the Youtube app or cloned NewPipe app.

I'm using an older Redmi device, which is running MIUI 12.5 but does not come with Sound Assistant, and is not rooted (rooting is not an option). I've used Shizuku + App Ops to turn off Audio Focus for the needed apps, so now I can play a mixtape on NewPipe and the lecture video on the Youtube app. But I cannot adjust the volumes for the two separately, so the music drowns out the instructor's voice in the lecture.

The only solution it seems is a YT frontend which has its own volume control i.e. the volume control in the app controls the volume of the output it sends to the main audio channel, rather than controlling the device volume.

Additional information

My current solution is using SoundAura from F-droid for the background music — it has its own internal volume control as needed; but it requires me to download the mixtape from YT into local as an mp3 (which I do with NewPipe), and I can't skip forward or backward on playback. SoundAura is open source on Github and written entirely in Kotlin, so I'm hoping importing this feature into NewPipe from their codebase wont be too much of hassle.

AudricV commented 11 months ago

I'm hoping importing this feature into NewPipe from their codebase wont be too much of hassle

No need to do so (this wouldn't be possible anyway, as this app uses directly Android media APIs while we use the ExoPlayer ones), ExoPlayer has an API to implement this feature, see Player.setVolume.

We already use it in the app for the in-app mute commands.