Android的 - 如何禁用音视频记录开始? [英] Android - How to disable sound on video recording start?

查看:146
本文介绍了Android的 - 如何禁用音视频记录开始?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android上,当你开始在你的应用程序录制视频有一个通知声音。有没有一种可靠的方法来禁用它?

On Android when you start recording video in your app there is a notification sound. Is there a reliable way to disable it?

推荐答案

对于非root权限的设备,如果固件允许静音声音,您可以通过使用静音 AudioManager.setStreamMute() STREAM_SYSTEM 在某些设备上),然后记录和录制开始时静音code>在 STREAM_MUSIC 。如果固件不允许这样它不会工作。在这种情况下,没有办法将其禁用以外生根它

For non-rooted devices, if the firmware allows muting that sound, you can mute it by using AudioManager.setStreamMute() on STREAM_MUSIC (or STREAM_SYSTEM on some devices) before recording and unmute when recording starts. It won't work if the firmware doesn't allow this. In this case, there is no way to disable it other than rooting it.

这篇关于Android的 - 如何禁用音视频记录开始?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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