1、查看audio的全部信息(各音频流音量,焦点,策略等)
dumpsys audio
2、设置音量并且显示音量UI
//stream 3表示多媒体,10表示音量值
media volume --show --stream 3 --set 10
3、音量调大调小
media volume --stream 3 --adj raise
media volume --stream 0 --adj lower
media volume --show --stream 3 --adj raise
media volume --show --stream 0 --adj lower
4、获取当前音量
media volume --stream 3 --get
5、直接调用Android接口设置音量
service call audio 7 i32 3 i32 10 i32 1
Here, the service call refers to IAudioService. Click here for more info.
7 is the function named setStreamVolume. It is the 7th in the list of functions in the interface IAudioService. Verify it here. (setStreamVolume takes 3 parameters streamType, index, flag)
i32 is to write the integer INT into the send parcel. (Alternatively we can make use of s16 for UTF-16 string)
3 is streamTypevalue. (Value