• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Help Per app media volume control via volume buttons

Overseer

Lurker
I'm looking to set up a Tasker profile so that when I am in a specific app (Twitter) the volume buttons will control the media volume rather than the ringer volume.

I have tried searching but cannot find anything.

Anyone have any ideas?
 
This is as far as I got with this idea ...

Profile: Twitter-Test
Application: Twitter
Enter: Anon
A1: Variable Set [ Name:%MediaSave To:%VOLM Do Maths:Off Append:Off ]
A2: Variable Set [ Name:%RingerSave To:%VOLR Do Maths:Off Append:Off ]
A3: Media Volume [ Level:%VOLR Display:Off Sound:Off ]
Exit: Anon
A1: Media Volume [ Level:%MediaSave Display:Off Sound:Off ]
A2: Ringer Volume [ Level:%RingerSave Display:Off Sound:Off ]

... Thom
 
The problem above is the profile will fire only once when you enter twitter, and won't do anything when you change volumes after entering twitter. So you need two profiles… one to fire when you enter twitter and the other to fire when you change ringer volume (after having entered twitter) as below

Profile: Twitter-Test
Context: Application: Twitter
Enter: Anon
A1: Variable Set [ Name:%RingerSave To:%VOLR Do Maths:Off Append:Off ]
A2: Set %TwitterActive = 1
Exit: Anon
A1: Ringer Volume [ Level:%RingerSave Display:Off Sound:Off ]
A2: Set %TwitterActive = 0
[End of profile Twitter-Test]


Profile: Volume Change:
Context1: State: %TwitterActive = 1
Context2: Event: Variable set: %VOLR
%VOLM = %VOLM + (%VOLR - %RingerSave)
%VOLR = %RingerSave
WAIT ONE SECOND
[End of profile VolumeChange]

The final wait is to ensure the profile doesn’t trigger itself when it changes VOLR.
Also set collision detect to “abort new task”

If you are not concerned about keeping ringer volume intact for the brief time you are on twitter, you could not change VOLR during the VolumeChange profile/task and just restore it during the test-twitter exit task.

I haven’t tested any of it.
 
Back
Top Bottom