降低系统音量 [英] Lower system volume

查看:107
本文介绍了降低系统音量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要降铃声,媒体音量,并从一个应用程序(按钮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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆