Android Question silence the shutter

AlpVir

Well-Known Member
Licensed User
Longtime User
I am using the CamEx library and am unable to silence the shutter.
I entered into CameraExClass the public sub :
B4X:
Public Sub EnableShutterSound(Enabled As Boolean) As Boolean
    r.target = nativeCam
    Return r.RunMethod2("enableShutterSound", Enabled, "java.lang.boolean")
End Sub

and I called EnableShutterSound in the InitializeCamera sub :
B4X:
    camEx.Initialize(PanelCamera, frontCamera, Me, "Camera1")
    camEx.EnableShutterSound(False)
The log is as follows :
findCamera
null
1
facing: 0, 0
cameraexclass_enableshuttersound (java line: 156)
java.lang.NoSuchMethodException: enableShutterSound
at java.lang.ClassCache.findMethodByName(ClassCache.java:247)
at java.lang.Class.getDeclaredMethod(Class.java:731)
at anywheresoftware.b4a.agraham.reflection.Reflection.runmethod(Reflection.java:214)
at anywheresoftware.b4a.agraham.reflection.Reflection.RunMethod2(Reflection.java:817)
at alpvir.fotoremota.cameraexclass._enableshuttersound(cameraexclass.java:156)
at alpvir.fotoremota.main._initializecamera(main.java:2128)
at alpvir.fotoremota.main$ResumableSub_Activity_Create.resume(main.java:1046)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:250)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:190)
at anywheresoftware.b4a.BA$2.run(BA.java:370)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3806)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)


thank you in advance
 

drgottjr

Expert
Licensed User
Longtime User
maybe see if this leads you anywhere. tests first to see if you can disable the shutter sound. might help to know...
B4X:
Camera.CameraInfo info = new Camera.CameraInfo();
Camera.getCameraInfo(id, info);
if (info.canDisableShutterSound) {
    mCamera.enableShutterSound(false);
}
 
Upvote 0
Top