停止相机咔嚓声编程的机器人 [英] stop camera click sound programmatically in android

查看:109
本文介绍了停止相机咔嚓声编程的机器人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Android的默认摄像机从内我的应用程序单击图像。我想停止它的点击图像的点击声。有没有办法制止这种咔嚓声programtically?

I am using android's default camera to click images from within my app. I want to stop the click sound that it does on clicking an image. Is there a way to stop that click sound programtically?

感谢。

推荐答案

要关闭声音使用该code:

To disable sound use this code:

AudioManager mgr = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
int streamType = AudioManager.STREAM_SYSTEM;
mgr.setStreamSolo(streamType, true);
mgr.setRingerMode(AudioManager.RINGER_MODE_SILENT);
mgr.setStreamMute(streamType, true);

要启用声音使用该code:

To enable sound use this code:

mgr = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
streamType = AudioManager.STREAM_SYSTEM;
mgr.setStreamSolo(streamType, false);
mgr.setRingerMode(AudioManager.RINGER_MODE_SILENT);
mgr.setStreamMute(streamType, false);

这篇关于停止相机咔嚓声编程的机器人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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