android.hardware.Camera.enableShutterSound()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(166)

本文整理了Java中android.hardware.Camera.enableShutterSound()方法的一些代码示例,展示了Camera.enableShutterSound()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Camera.enableShutterSound()方法的具体详情如下:
包路径:android.hardware.Camera
类名称:Camera
方法名:enableShutterSound

Camera.enableShutterSound介绍

暂无

代码示例

代码示例来源:origin: StannyBing/ZXUtils

private synchronized void openCamera(int id) {
  try {
    this.mCamera = Camera.open(id);
  } catch (Exception var3) {
    var3.printStackTrace();
    if (this.errorLisenter != null) {
      this.errorLisenter.onError(CameraListener.ErrorType.OpenCameraError);
    }
  }
  if (Build.VERSION.SDK_INT > 17 && this.mCamera != null) {
    try {
      this.mCamera.enableShutterSound(false);
    } catch (Exception e) {
      e.printStackTrace();
      Log.e("CJT", "enable shutter sound faild");
    }
  }
}

代码示例来源:origin: LLhon/Android-Video-Editor

private synchronized void openCamera(int id) {
  try {
    this.mCamera = Camera.open(id);
  } catch (Exception var3) {
    var3.printStackTrace();
    if (this.errorLisenter != null) {
      this.errorLisenter.onError();
    }
  }
  if (Build.VERSION.SDK_INT > 17 && this.mCamera != null) {
    try {
      this.mCamera.enableShutterSound(false);
    } catch (Exception e) {
      e.printStackTrace();
      Log.e("CJT", "enable shutter sound faild");
    }
  }
}

代码示例来源:origin: hschott/Camdroid

public void createCamera() {
  Log.d(TAG, "createCamera()");
  // Open the default i.e. the first rear facing camera.
  int cameraIndex = CameraManager.firstBackFacingCamera();
  this.mCamera = CameraManager.openCamera(cameraIndex);
  if (this.mCamera == null) {
    return;
  }
  CameraManager.initializeCamera(this.mCamera);
  Log.d(TAG, "camera created");
  CameraInfo cameraInfo = new CameraInfo();
  Camera.getCameraInfo(cameraIndex, cameraInfo);
  boolean canDisableSystemShutterSound = false;
  if (cameraInfo.canDisableShutterSound) {
    canDisableSystemShutterSound = this.mCamera
        .enableShutterSound(false);
  }
  this.mAutoFocusManager = new AutoFocusManager(this.getContext()
      .getApplicationContext(), this.mCamera,
      canDisableSystemShutterSound);
}

代码示例来源:origin: LLhon/Android-Video-Editor

public synchronized void switchCamera(SurfaceHolder holder, float screenProp) {
    if (SELECTED_CAMERA == CAMERA_POST_POSITION) {
      SELECTED_CAMERA = CAMERA_FRONT_POSITION;
    } else {
      SELECTED_CAMERA = CAMERA_POST_POSITION;
    }
    doDestroyCamera();
    LogUtil.i("open start");
    openCamera(SELECTED_CAMERA);
//        mCamera = Camera.open();
    if (Build.VERSION.SDK_INT > 17 && this.mCamera != null) {
      try {
        this.mCamera.enableShutterSound(false);
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
    LogUtil.i("open end");
    doStartPreview(holder, screenProp);
  }

代码示例来源:origin: StannyBing/ZXUtils

public synchronized void switchCamera(SurfaceHolder holder, float screenProp) {
    if (SELECTED_CAMERA == CAMERA_POST_POSITION) {
      SELECTED_CAMERA = CAMERA_FRONT_POSITION;
    } else {
      SELECTED_CAMERA = CAMERA_POST_POSITION;
    }
    doDestroyCamera();
    ZXLogUtil.logi("open start");
    openCamera(SELECTED_CAMERA);
//        mCamera = Camera.open();
    if (Build.VERSION.SDK_INT > 17 && this.mCamera != null) {
      try {
        this.mCamera.enableShutterSound(false);
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
    ZXLogUtil.logi("open end");
    doStartPreview(holder, screenProp);
  }

代码示例来源:origin: EzequielAdrianM/Camera2Vision

Camera.getCameraInfo(cameraId, camInfo);
if(camInfo.canDisableShutterSound) {
  mCamera.enableShutterSound(false);

相关文章