gpt4 book ai didi

音量控制键控制的音频流(setVolumeControlStream)描述

转载 作者:qq735679552 更新时间:2022-09-28 22:32:09 28 4
gpt4 key购买 nike

CFSDN坚持开源创造价值,我们致力于搭建一个资源共享平台,让每一个IT人在这里找到属于你的精彩世界.

这篇CFSDN的博客文章音量控制键控制的音频流(setVolumeControlStream)描述由作者收集整理,如果你对这篇文章有兴趣,记得点赞哟.

当开发多媒体应用或者游戏应用的时候,需要使用音量控制键来设置程序的音量大小。在Android系统中有多中音频流,通过Activity中的函数 setVolumeControlStream(int streamType)可以设置该Activity中音量控制键控制的音频流,一般在onCreate函数中设置。 Android中有如下几种音频流: •AudioManager.STREAM_MUSIC /** The audio stream for music playback */ •AudioManager.STREAM_RING /** The audio stream for the phone ring */ •AudioManager.STREAM_ALARM /** The audio stream for alarms */ •AudioManager.STREAM_NOTIFICATION /** The audio stream for notifications */ •AudioManager.STREAM_SYSTEM /** The audio stream for system sounds */ •AudioManager.STREAM_VOICECALL /** The audio stream for phone calls */ setVolumeControlStream函数描述: void android.app.Activity .setVolumeControlStream(int streamType) Suggests an audio stream whose volume should be changed by the hardware volume controls. The suggested audio stream will be tied to the window of this Activity. If the Activity is switched, the stream set here is no longer the suggested stream. The client does not need to save and restore the old suggested stream value in onPause and onResume. Parameters: streamType The type of the audio stream whose volume should be changed by the hardware volume controls. It is not guaranteed that the hardware volume controls will always change this stream's volume (for example, if a call is in progress, its stream's volume may be changed instead). To reset back to the default, use AudioManager.USE_DEFAULT_STREAM_TYPE . 。

最后此篇关于音量控制键控制的音频流(setVolumeControlStream)描述的文章就讲到这里了,如果你想了解更多关于音量控制键控制的音频流(setVolumeControlStream)描述的内容请搜索CFSDN的文章或继续浏览相关文章,希望大家以后支持我的博客! 。

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com