亚行命令来设置音量? [英] ADB Command to set volume?
问题描述
有没有亚行命令,将音量设置为一个特定的值?我知道,我们可以做
Is there any Adb command to set the volume to a particular value? I know that we can do
adb shell input keyevent
有关音量上下,但我想将它设置为一个特定的值。如果我改变它数据库,然后我不得不重新启动设备,使更改反映,所以我不想去这条道路。是不是有什么API,我可以改变的价值,而无需重新启动它,不得不依赖于音量上下?
for volume up and down but i want to set it to a particular value. If I change it it DB then I have to reboot the device for the changes to be reflected so i do not want to go that path. Isn't there any API where I can change the value without having to restart it and having to be dependent on Volume up and Down?
推荐答案
在一个有根的电话,你可以打电话 setMasterVolume()
与服务呼叫音频< code取代; I32<体积GT;
。 C $ CS中的$是特定版本。比方说,你想一个奇巧设备上设置音量为50%。该命令将是:
On a rooted phone you can call setMasterVolume()
with service call audio <code> i32 <volume>
. The codes are version specific. Let's say you want to set volume to 50% on a KitKat device. The command will be:
service call audio 9 i32 50
这篇关于亚行命令来设置音量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!