Advertisement
metalx1000

Android Shell ADB Audio Volume Control

May 20th, 2020
2,697
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.48 KB | None | 0 0
  1. #Android Shell ADB Audio Volume Control
  2.  
  3. #list help options
  4. media
  5.  
  6. #loop throw devices
  7. for s in $(seq 0 20);
  8. do
  9.   media volume --stream $s --get 2>/dev/null|grep -v "Connecting to AudioService"|grep -v "will get volume";
  10.   echo "---------";
  11. done
  12.  
  13. ###HELP OUTPUT###
  14. usage: media [subcommand] [options]
  15.        media dispatch KEY
  16.        media list-sessions
  17.        media monitor <tag>
  18.        media volume [options]
  19.  
  20. media dispatch: dispatch a media key to the system.
  21.                 KEY may be: play, pause, play-pause, mute, headsethook,
  22.                 stop, next, previous, rewind, record, fast-forword.
  23. media list-sessions: print a list of the current sessions.
  24. media monitor: monitor updates to the specified session.
  25.                        Use the tag from list-sessions.
  26. media volume:  the options are as follows:
  27.                 --stream STREAM selects the stream to control, see AudioManager.STREAM_*
  28.                                 controls AudioManager.STREAM_MUSIC if no stream is specified
  29.                 --set INDEX     sets the volume index value
  30.                 --adj DIRECTION adjusts the volume, use raise|same|lower for the direction
  31.                 --get           outputs the current volume
  32.                 --show          shows the UI during the volume change
  33.         examples:
  34.                 adb shell media volume --show --stream 3 --set 11
  35.                 adb shell media volume --stream 0 --adj lower
  36.                 adb shell media volume --stream 3 --get
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement