降低系统音量 [英] Lower system volume
问题描述
我要降铃声,媒体音量,并从一个应用程序(按钮preSS,无滑块)报警音量。所以,我一直在阅读了关于 AudioManager ,但我仍然有点糊涂就如何做到这一点。
此外,随着音频管理器,是整部手机或只为应用程序设置的音量?我想这是整个手机
但我仍然对如何做到这一点有点困惑
块引用>呼叫
adjustStreamVolume()
与希望的流(例如,STREAM_ALARM
)和变化(例如,1
)。 下面是一个示例项目演示这一点。
对于整个手机或只是应用程序?
设置音量
块引用>Android不具备特定应用量的概念,所以这是整部手机。
I want to lower the ringtone, media volume, and alarm volume from an app (button press, no slider). So I've been reading up on AudioManager , but I'm still a bit confused on how to do this.
Also, with Audio Manager, is the volume set for the whole phone or just for the app? I want it to be for the whole phone
解决方案but I'm still a bit confused on how to do this
Call
adjustStreamVolume()
with your desired stream (e.g.,STREAM_ALARM
) and change (e.g.,-1
). Here is a sample project that demonstrates this.is the volume set for the whole phone or just for the app?
Android does not have a concept of app-specific volume, so this is for the whole phone.
这篇关于降低系统音量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!